Skip to content

Commit b7f5b5c

Browse files
authored
update websocket port (#261)
1 parent bc3a67b commit b7f5b5c

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ CHINOOK_DATABASE_URL="sqlitecloud://user:password@xxx.sqlite.cloud:8860/chinook.
99
CHINOOK_API_KEY=xxxxxx
1010

1111
# sqlite cloud gateway for socket.io connections
12-
GATEWAY_URL=ws://localhost:4000
12+
GATEWAY_URL=ws://localhost:443

examples/with-javascript-browser/index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ <h1>SQLite Cloud Drivers</h1>
1919
<div class="text-xs w-12">databaseUrl</div>
2020
<input type="text" id="connectionStringInput"
2121
placeholder="Example: sqlitecloud://admin:password@host.sqlite.cloud:8860/chinook.sqlite"
22-
value="sqlitecloud://host.sqlite.cloud:8860?apikey=apikey"
23-
class="border rounded w-full pl-2 pr-2 mb-2" />
22+
value="sqlitecloud://host.sqlite.cloud:8860?apikey=apikey" class="border rounded w-full pl-2 pr-2 mb-2" />
2423
<div class="text-sm w-12">sql:</div>
2524
<input type="text" id="messageInput"
2625
placeholder="Example: USE DATABASE chinook.sqlite; select * from customers limit 3"
@@ -51,7 +50,7 @@ <h2 class="pb-4">Results:</h2>
5150
// connect via websocket to the gateway on the same server
5251
const connectionConfig = {
5352
gatewayUrl: `${window.location.protocol === 'https:' ? 'wss' : 'ws'
54-
}://${window.location.hostname}:4000`,
53+
}://${window.location.hostname}:443`,
5554
connectionstring: connectionstring,
5655
};
5756
var database = new window.sqlitecloud.Database(

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sqlitecloud/drivers",
3-
"version": "1.0.739",
3+
"version": "1.0.779",
44
"description": "SQLiteCloud drivers for Typescript/Javascript in edge, web and node clients",
55
"main": "./lib/index.js",
66
"types": "./lib/index.d.ts",
@@ -109,4 +109,4 @@
109109
"browser": {
110110
"tls": false
111111
}
112-
}
112+
}

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 || `${this.config.host === 'localhost' ? 'ws' : 'wss'}://${this.config.host as string}:4000`
33+
const gatewayUrl = this.config?.gatewayurl || `${this.config.host === 'localhost' ? 'ws' : 'wss'}://${this.config.host as string}:443`
3434
this.socket = io(gatewayUrl, { auth: { token: connectionstring } })
3535

3636
this.socket.on('connect', () => {

src/drivers/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ export interface SQLiteCloudConfig {
8585

8686
/** True if we should force use of SQLite Cloud Gateway and websocket connections, default: true in browsers, false in node.js */
8787
usewebsocket?: boolean
88-
/** Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. wss://host:4000 */
88+
/** Url where we can connect to a SQLite Cloud Gateway that has a socket.io deamon waiting to connect, eg. wss://host:443 */
8989
gatewayurl?: string
9090

9191
/** Optional identifier used for verbose logging */

0 commit comments

Comments
 (0)