Skip to content

Commit 7b5f8eb

Browse files
Enable ?useWebsocket= in connection strings
1 parent 0e9a1f4 commit 7b5f8eb

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/transport-ws.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class WebSocketTransport implements ConnectionTransport {
3232
if (!this.socket) {
3333
this.config = config
3434
let connectionString = this.config.connectionString as string
35-
let gatewayUrl = this.config.websocketOptions?.gatewayUrl || `ws://${this.config.host}:4000`
35+
let gatewayUrl = this.config?.gatewayUrl || `ws://${this.config.host}:4000`
3636
this.socket = io(gatewayUrl, { auth: { token: connectionString } })
3737
}
3838
callback?.call(this, null)

src/types.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,10 @@ export interface SQLiteCloudConfig {
4747
/** Custom options and configurations for tls socket, eg: additional certificates */
4848
tlsOptions?: tls.ConnectionOptions
4949

50-
/** Custom options and configurations for socket.io connections */
51-
websocketOptions?: {
52-
/** True if we should force use of SQLite Cloud Gateway and websocket connections, default: true in browsers, false in node.js */
53-
useWebsocket?: boolean
54-
/** Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. ws://host:4000 */
55-
gatewayUrl?: string
56-
}
50+
/** True if we should force use of SQLite Cloud Gateway and websocket connections, default: true in browsers, false in node.js */
51+
useWebsocket?: boolean
52+
/** Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. ws://host:4000 */
53+
gatewayUrl?: string
5754

5855
/** Optional identifier used for verbose logging */
5956
clientId?: string

0 commit comments

Comments
 (0)