Skip to content

Commit

Permalink
make 'port' optional when providing settings for Client constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
endel committed May 5, 2023
1 parent a5b58b2 commit ad969ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
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.15.4",
"version": "0.15.5",
"description": "Colyseus Multiplayer SDK for JavaScript/TypeScript",
"author": "Endel Dreyer",
"license": "MIT",
Expand Down
5 changes: 4 additions & 1 deletion src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const DEFAULT_ENDPOINT = (typeof (window) !== "undefined" && typeof (window?.lo

export interface EndpointSettings {
hostname: string,
port: number,
secure: boolean,
port?: number,
}

export class Client {
Expand All @@ -43,6 +43,9 @@ export class Client {
};

} else {
if (settings.port === undefined) {
settings.port = (settings.secure) ? 443 : 80;
}
this.settings = settings;
}
}
Expand Down

0 comments on commit ad969ba

Please sign in to comment.