Skip to content

Commit 0cbb9fb

Browse files
Connect via regular websocket in localhost
1 parent 7cc3e2a commit 0cbb9fb

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/drivers/connection-ws.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class SQLiteCloudWebsocketConnection extends SQLiteCloudConnection {
3030
if (!this.socket) {
3131
this.config = config
3232
const connectionString = this.config.connectionString as string
33-
const gatewayUrl = this.config?.gatewayUrl || `ws://${this.config.host as string}:4000`
33+
const gatewayUrl = this.config?.gatewayUrl || `${this.config.host === 'localhost' ? 'ws' : 'wss'}://${this.config.host as string}:4000`
3434
this.socket = io(gatewayUrl, { auth: { token: connectionString } })
3535
}
3636
callback?.call(this, null)

0 commit comments

Comments
 (0)