Skip to content

Commit 070c4c9

Browse files
committed
feat(reactive-rpc): 🎸 allow to specify IP and token
1 parent 340c749 commit 070c4c9

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/reactive-rpc/common/testing/buildE2eClient.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,25 @@ export interface BuildE2eClientOptions {
6464
* values. Defaults to `[0, 0]`.
6565
*/
6666
clientBufferTime?: [min: number, max: number];
67+
68+
/**
69+
* IP address to use for the connection. Defaults to `0.0.0.0`.
70+
*/
71+
ip?: string;
72+
73+
/**
74+
* Authentication token to use for the connection. Defaults to empty string.
75+
*/
76+
token?: string;
6777
}
6878

6979
export const buildE2eClient = <T = RpcClient>(opt: BuildE2eClientOptions) => {
7080
const caller = opt.caller;
7181
const writer = opt.writer ?? new Writer(Fuzzer.randomInt2(opt.writerDefaultBufferKb ?? [4, 4]) * 1024);
7282
const codecs = new RpcCodecs(new Codecs(writer), new RpcMessageCodecs());
7383
const ctx = new ConnectionContext(
74-
'0.0.0.0',
75-
'',
84+
opt.ip ?? '0.0.0.0',
85+
opt.ip ?? '',
7686
null,
7787
{},
7888
codecs.value.cbor,

0 commit comments

Comments
 (0)