diff --git a/src/core/mux-relay.js b/src/core/mux-relay.js index 645033a..64782b3 100644 --- a/src/core/mux-relay.js +++ b/src/core/mux-relay.js @@ -5,6 +5,8 @@ import { TcpInbound, TcpOutbound, TlsInbound, TlsOutbound, WsInbound, WsOutbound, + WssInbound, WssOutbound, + Http2Inbound, Http2Outbound, MuxInbound, MuxOutbound, } from '../transports'; @@ -25,6 +27,8 @@ export class MuxRelay extends Relay { 'tcp': [TcpInbound, TcpOutbound], 'tls': [TlsInbound, TlsOutbound], 'ws': [WsInbound, WsOutbound], + 'wss': [WssInbound, WssOutbound], + 'h2': [Http2Inbound, Http2Outbound], }; const [Inbound, Outbound] = this._config.is_client ? [MuxInbound, mapping[transport][1]] : [mapping[transport][0], MuxOutbound]; return { Inbound, Outbound }; diff --git a/test/e2e/multiplexing.test.js b/test/e2e/multiplexing.test.js index 38e4a8a..a525fbc 100644 --- a/test/e2e/multiplexing.test.js +++ b/test/e2e/multiplexing.test.js @@ -50,6 +50,19 @@ test('multiplexing over tcp', async () => { await run({ clientJson, serverJson, repeat: 10, isUdp: true }); }); +test('multiplexing over tls', async () => { + const service = 'tls://localhost:1082'; + + const clientJson = clone(client); + const serverJson = clone(server); + + clientJson.server.service = service; + serverJson.service = service; + + await run({ clientJson, serverJson, repeat: 10 }); + await run({ clientJson, serverJson, repeat: 10, isUdp: true }); +}); + test('multiplexing over ws', async () => { const service = 'ws://127.0.0.1:1082'; @@ -63,8 +76,21 @@ test('multiplexing over ws', async () => { await run({ clientJson, serverJson, repeat: 10, isUdp: true }); }); -test('multiplexing over tls', async () => { - const service = 'tls://localhost:1082'; +test('multiplexing over wss', async () => { + const service = 'wss://localhost:1082'; + + const clientJson = clone(client); + const serverJson = clone(server); + + clientJson.server.service = service; + serverJson.service = service; + + await run({ clientJson, serverJson, repeat: 10 }); + await run({ clientJson, serverJson, repeat: 10, isUdp: true }); +}); + +test('multiplexing over h2', async () => { + const service = 'h2://localhost:1082'; const clientJson = clone(client); const serverJson = clone(server);