Skip to content

Commit

Permalink
use same protocol/hostname:port if endpoint is not provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed Oct 9, 2019
1 parent b803e35 commit a38b2e8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/colyseus.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "colyseus.js",
"version": "0.11.2",
"version": "0.11.3",
"description": "Multiplayer Game Client for the Browser",
"keywords": [
"colyseus",
Expand Down
2 changes: 1 addition & 1 deletion src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Client {

protected endpoint: string;

constructor(endpoint: string) {
constructor(endpoint: string = `${location.protocol.replace("http", "ws")}//${location.hostname}${(location.port && `:${location.port}`)}`) {
this.endpoint = endpoint;
this.auth = new Auth(this.endpoint);
this.push = new Push(this.endpoint);
Expand Down

0 comments on commit a38b2e8

Please sign in to comment.