@@ -3,10 +3,12 @@ import {RpcCodec} from '../../common/codec/RpcCodec';
33import { RpcPersistentClient , StreamingRpcClient , WebSocketChannel } from '../../common' ;
44import { FetchRpcClient } from '../../common/rpc/client/FetchRpcClient' ;
55
6- const host = '54.204.106.133' ;
6+ const secure = true ;
7+ const host = 'demo-iasd8921ondk0.jsonjoy.com' ;
8+ // const host = '127.0.0.1:8080';
79
810export const setupDemoServerPersistentClient = ( codec : RpcCodec ) => {
9- const url = `ws://${ host } /rpc` ;
11+ const url = `ws${ secure ? 's' : '' } ://${ host } /rpc` ;
1012 const client = new RpcPersistentClient ( {
1113 codec,
1214 channel : {
@@ -24,7 +26,7 @@ export const setupDemoServerPersistentClient = (codec: RpcCodec) => {
2426} ;
2527
2628export const setupDemoServerFetchClient = ( codec : RpcCodec ) => {
27- const url = `http://${ host } /rpc` ;
29+ const url = `http${ secure ? 's' : '' } ://${ host } /rpc` ;
2830 const client = new FetchRpcClient ( {
2931 url,
3032 msgCodec : codec . msg ,
@@ -43,7 +45,7 @@ export const setupDemoServerStreamingClient = (codec: RpcCodec) => {
4345 const client = new StreamingRpcClient ( {
4446 send : async ( messages ) => {
4547 const port = + ( process . env . PORT || 9999 ) ;
46- const url = `http://${ host } /rpc` ;
48+ const url = `http${ secure ? 's' : '' } ://${ host } /rpc` ;
4749 codec . req . encoder . writer . reset ( ) ;
4850 codec . msg . encodeBatch ( codec . req , messages ) ;
4951 const body = codec . req . encoder . writer . flush ( ) ;
0 commit comments