Results:
// connect via websocket to the gateway on the same server
const connectionConfig = {
gatewayUrl: `${window.location.protocol === 'https:' ? 'wss' : 'ws'
- }://${window.location.hostname}:4000`,
+ }://${window.location.hostname}:443`,
connectionstring: connectionstring,
};
var database = new window.sqlitecloud.Database(
diff --git a/package.json b/package.json
index 5d56453..e1d86a5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@sqlitecloud/drivers",
- "version": "1.0.739",
+ "version": "1.0.779",
"description": "SQLiteCloud drivers for Typescript/Javascript in edge, web and node clients",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
@@ -109,4 +109,4 @@
"browser": {
"tls": false
}
-}
+}
\ No newline at end of file
diff --git a/src/drivers/connection-ws.ts b/src/drivers/connection-ws.ts
index 0f5352d..381c939 100644
--- a/src/drivers/connection-ws.ts
+++ b/src/drivers/connection-ws.ts
@@ -30,7 +30,7 @@ export class SQLiteCloudWebsocketConnection extends SQLiteCloudConnection {
if (!this.socket) {
this.config = config
const connectionstring = this.config.connectionstring as string
- const gatewayUrl = this.config?.gatewayurl || `${this.config.host === 'localhost' ? 'ws' : 'wss'}://${this.config.host as string}:4000`
+ const gatewayUrl = this.config?.gatewayurl || `${this.config.host === 'localhost' ? 'ws' : 'wss'}://${this.config.host as string}:443`
this.socket = io(gatewayUrl, { auth: { token: connectionstring } })
this.socket.on('connect', () => {
diff --git a/src/drivers/types.ts b/src/drivers/types.ts
index 8e9f9e1..3e5e4d9 100644
--- a/src/drivers/types.ts
+++ b/src/drivers/types.ts
@@ -85,7 +85,7 @@ export interface SQLiteCloudConfig {
/** True if we should force use of SQLite Cloud Gateway and websocket connections, default: true in browsers, false in node.js */
usewebsocket?: boolean
- /** Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. wss://host:4000 */
+ /** Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. wss://host:443 */
gatewayurl?: string
/** Optional identifier used for verbose logging */