File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11BACKEND = http://localhost:6060
22SYNC_SERVICE = http://localhost:8080
33POWERSYNC_TOKEN =
4+ POWERSYNC_DEBUG = 1
Original file line number Diff line number Diff line change @@ -33,7 +33,24 @@ const main = async () => {
3333 } ) ;
3434 console . log ( await db . get ( 'SELECT powersync_rs_version();' ) ) ;
3535
36- await db . connect ( new DemoConnector ( ) , { connectionMethod : SyncStreamConnectionMethod . HTTP } ) ;
36+ await db . connect ( new DemoConnector ( ) , {
37+ connectionMethod : SyncStreamConnectionMethod . WEB_SOCKET
38+ } ) ;
39+ // Example using a proxy agent for more control over the connection:
40+ // const proxyAgent = new (await import('undici')).ProxyAgent({
41+ // uri: 'http://localhost:8080',
42+ // requestTls: {
43+ // ca: '<CA for the service>'
44+ // },
45+ // proxyTls: {
46+ // ca: '<CA for the proxy>'
47+ // }
48+ // });
49+ // await db.connect(new DemoConnector(), {
50+ // connectionMethod: SyncStreamConnectionMethod.WEB_SOCKET,
51+ // dispatcher: proxyAgent
52+ // });
53+
3754 await db . waitForFirstSync ( ) ;
3855 console . log ( 'First sync complete!' ) ;
3956
You can’t perform that action at this time.
0 commit comments