Skip to content

Commit 90cc182

Browse files
committed
test: 💍 add demo server test url
1 parent 123cd6e commit 90cc182

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/__tests__/e2e/demo-client.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import {RpcCodec} from '../../common/codec/RpcCodec';
33
import {RpcPersistentClient, StreamingRpcClient, WebSocketChannel} from '../../common';
44
import {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

810
export 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

2628
export 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

Comments
 (0)