Skip to content

Commit

Permalink
fix: error handling for localhost
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeeshan committed Jun 8, 2023
1 parent 579e86d commit 57a4c1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ export class WsClient extends Emittery {
*/
static connect(url: string) {
return new Promise<WsClient>((resolve, reject) => {
if (url.includes("localhost")) {
throw new Error('localhost is not supported in the url. Use "127.0.0.1" instead.');
}
const socket = new IsoWebSocket(url);
// make sure that there are no uncaught connection
// errors because that causes nodejs thread to crash
Expand Down

0 comments on commit 57a4c1d

Please sign in to comment.