@socket-mesh/server 18.1.3 → 18.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/broker/broker-events.d.ts +4 -4
- package/dist/broker/broker.d.ts +10 -10
- package/dist/broker/broker.js +2 -1
- package/dist/broker/exchange-client.d.ts +1 -1
- package/dist/broker/exchange.d.ts +1 -1
- package/dist/broker/exchange.js +2 -1
- package/dist/broker/index.d.ts +5 -0
- package/dist/broker/index.js +5 -0
- package/dist/broker/simple-broker.d.ts +8 -8
- package/dist/broker/simple-broker.js +26 -23
- package/dist/broker/simple-exchange.d.ts +7 -7
- package/dist/broker/simple-exchange.js +15 -12
- package/dist/events/index.d.ts +49 -0
- package/dist/handlers/authenticate.d.ts +12 -13
- package/dist/handlers/authenticate.js +29 -28
- package/dist/handlers/handshake.d.ts +3 -7
- package/dist/handlers/handshake.js +17 -13
- package/dist/handlers/index.d.ts +7 -0
- package/dist/handlers/index.js +7 -0
- package/dist/handlers/publish.d.ts +4 -10
- package/dist/handlers/publish.js +2 -2
- package/dist/handlers/remove-auth-token.d.ts +4 -3
- package/dist/handlers/server-request-handler.d.ts +7 -0
- package/dist/handlers/subscribe.d.ts +3 -7
- package/dist/handlers/subscribe.js +3 -3
- package/dist/handlers/unsubscribe.d.ts +2 -6
- package/dist/handlers/unsubscribe.js +2 -2
- package/dist/index.d.ts +20 -18
- package/dist/index.js +19 -20
- package/dist/plugin/server-plugin.d.ts +25 -25
- package/dist/server-options.d.ts +12 -11
- package/dist/server-socket.d.ts +21 -19
- package/dist/server-socket.js +11 -5
- package/dist/server-transport.d.ts +24 -23
- package/dist/server-transport.js +44 -36
- package/dist/server.d.ts +91 -91
- package/dist/server.js +100 -73
- package/package.json +55 -26
- package/dist/maps/client-map.d.ts +0 -10
- package/dist/maps/server-map.d.ts +0 -24
- package/dist/maps/socket-map.d.ts +0 -19
- package/dist/maps/socket-map.js +0 -1
- package/dist/server-event.d.ts +0 -52
- package/dist/server-event.js +0 -1
- /package/dist/{maps/client-map.js → events/index.js} +0 -0
- /package/dist/{maps/server-map.js → handlers/server-request-handler.js} +0 -0
package/dist/server.d.ts
CHANGED
|
@@ -1,52 +1,111 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AsyncStreamEmitter } from '@socket-mesh/async-stream-emitter';
|
|
2
|
+
import { AuthEngine } from '@socket-mesh/auth-engine';
|
|
3
|
+
import { ChannelMap } from '@socket-mesh/channels';
|
|
4
|
+
import { PrivateMethodMap, PublicMethodMap, ServiceMap, StreamCleanupMode } from '@socket-mesh/core';
|
|
5
|
+
import { CodecEngine } from '@socket-mesh/formatter';
|
|
6
|
+
import { DemuxedConsumableStream, StreamEvent } from '@socket-mesh/stream-demux';
|
|
2
7
|
import { Server as HttpServer } from 'http';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { ServerPlugin } from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
import { ServerOptions } from "./server-options.js";
|
|
11
|
-
import { ServerMap } from "./maps/server-map.js";
|
|
12
|
-
import { Broker } from "./broker/broker.js";
|
|
13
|
-
import { Exchange } from "./broker/exchange.js";
|
|
14
|
-
export declare class Server<T extends ServerMap> extends AsyncStreamEmitter<ServerEvent<T>> {
|
|
8
|
+
import { Broker } from './broker/broker.js';
|
|
9
|
+
import { Exchange } from './broker/exchange.js';
|
|
10
|
+
import { CloseEvent, ConnectionEvent, ErrorEvent, HandshakeEvent, HeadersEvent, ListeningEvent, ServerEvent, SocketAuthenticateEvent, SocketAuthStateChangeEvent, SocketBadAuthTokenEvent, SocketCloseEvent, SocketConnectEvent, SocketConnectingEvent, SocketDeauthenticateEvent, SocketDisconnectEvent, SocketErrorEvent, SocketMessageEvent, SocketPingEvent, SocketPongEvent, SocketRemoveAuthTokenEvent, SocketRequestEvent, SocketResponseEvent, SocketSubscribeEvent, SocketSubscribeFailEvent, SocketSubscribeStateChangeEvent, SocketUnsubscribeEvent, WarningEvent } from './events/index.js';
|
|
11
|
+
import { ServerPlugin } from './plugin/server-plugin.js';
|
|
12
|
+
import { ServerOptions } from './server-options.js';
|
|
13
|
+
import { ServerSocket } from './server-socket.js';
|
|
14
|
+
export declare class Server<TIncoming extends PublicMethodMap = {}, TChannel extends ChannelMap = {}, TService extends ServiceMap = {}, TOutgoing extends PublicMethodMap = {}, TPrivateIncoming extends PrivateMethodMap = {}, TPrivateOutgoing extends PrivateMethodMap = {}, TServerState extends object = {}, TState extends object = {}> extends AsyncStreamEmitter<ServerEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>> {
|
|
15
15
|
private readonly _callIdGenerator;
|
|
16
|
-
private
|
|
17
|
-
private _isReady;
|
|
16
|
+
private _handlers;
|
|
18
17
|
private _isListening;
|
|
18
|
+
private _isReady;
|
|
19
19
|
private _pingIntervalRef;
|
|
20
|
-
private
|
|
20
|
+
private readonly _wss;
|
|
21
21
|
ackTimeoutMs: number;
|
|
22
22
|
allowClientPublish: boolean;
|
|
23
|
-
pingIntervalMs: number;
|
|
24
|
-
isPingTimeoutDisabled: boolean;
|
|
25
|
-
origins: string;
|
|
26
|
-
pingTimeoutMs: number;
|
|
27
|
-
socketChannelLimit?: number;
|
|
28
|
-
strictHandshake: boolean;
|
|
29
23
|
readonly auth: AuthEngine;
|
|
30
|
-
readonly brokerEngine: Broker<
|
|
24
|
+
readonly brokerEngine: Broker<TChannel>;
|
|
25
|
+
clientCount: number;
|
|
31
26
|
readonly clients: {
|
|
32
|
-
[id: string]: ServerSocket<
|
|
27
|
+
[id: string]: ServerSocket<TIncoming, TChannel, TService, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>;
|
|
33
28
|
};
|
|
34
|
-
clientCount: number;
|
|
35
29
|
readonly codecEngine: CodecEngine;
|
|
30
|
+
readonly httpServer: HttpServer;
|
|
31
|
+
isPingTimeoutDisabled: boolean;
|
|
32
|
+
origins: string;
|
|
33
|
+
pendingClientCount: number;
|
|
36
34
|
readonly pendingClients: {
|
|
37
|
-
[id: string]: ServerSocket<
|
|
35
|
+
[id: string]: ServerSocket<TIncoming, TChannel, TService, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>;
|
|
38
36
|
};
|
|
39
|
-
|
|
37
|
+
pingIntervalMs: number;
|
|
38
|
+
pingTimeoutMs: number;
|
|
39
|
+
readonly plugins: ServerPlugin<TIncoming, TChannel, TService, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>[];
|
|
40
|
+
socketChannelLimit?: number;
|
|
40
41
|
readonly socketStreamCleanupMode: StreamCleanupMode;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
addPlugin(...plugin: ServerPlugin<T>[]): void;
|
|
42
|
+
strictHandshake: boolean;
|
|
43
|
+
constructor(options?: ServerOptions<TIncoming, TChannel, TService, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>);
|
|
44
|
+
addPlugin(...plugin: ServerPlugin<TIncoming, TChannel, TService, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>[]): void;
|
|
45
45
|
private bind;
|
|
46
46
|
close(keepSocketsOpen?: boolean): Promise<void>;
|
|
47
|
-
|
|
47
|
+
emit(event: 'close', data: CloseEvent): void;
|
|
48
|
+
emit(event: 'connection', data: ConnectionEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
49
|
+
emit(event: 'error', data: ErrorEvent): void;
|
|
50
|
+
emit(event: 'headers', data: HeadersEvent): void;
|
|
51
|
+
emit(event: 'handshake', data: HandshakeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
52
|
+
emit(event: 'listening', data: ListeningEvent): void;
|
|
53
|
+
emit(event: 'ready', data: {}): void;
|
|
54
|
+
emit(event: 'socketAuthStateChange', data: SocketAuthStateChangeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
55
|
+
emit(event: 'socketAuthenticate', data: SocketAuthenticateEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
56
|
+
emit(event: 'socketBadAuthToken', data: SocketBadAuthTokenEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
57
|
+
emit(event: 'socketClose', data: SocketCloseEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
58
|
+
emit(event: 'socketConnect', data: SocketConnectEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
59
|
+
emit(event: 'socketConnectAbort', data: SocketDisconnectEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
60
|
+
emit(event: 'socketConnecting', data: SocketConnectingEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
61
|
+
emit(event: 'socketDeauthenticate', data: SocketDeauthenticateEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
62
|
+
emit(event: 'socketDisconnect', data: SocketDisconnectEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
63
|
+
emit(event: 'socketError', data: SocketErrorEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
64
|
+
emit(event: 'socketMessage', data: SocketMessageEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
65
|
+
emit(event: 'socketPing', data: SocketPingEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
66
|
+
emit(event: 'socketPong', data: SocketPongEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
67
|
+
emit(event: 'socketRemoveAuthToken', data: SocketRemoveAuthTokenEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
68
|
+
emit(event: 'socketRequest', data: SocketRequestEvent<TService, TIncoming, TPrivateIncoming>): void;
|
|
69
|
+
emit(event: 'socketResponse', data: SocketResponseEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
70
|
+
emit(event: 'socketSubscribe', data: SocketSubscribeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
71
|
+
emit(event: 'socketSubscribeFail', data: SocketSubscribeFailEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
72
|
+
emit(event: 'socketSubscribeRequest', data: SocketSubscribeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
73
|
+
emit(event: 'socketSubscribeStateChange', data: SocketSubscribeStateChangeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
74
|
+
emit(event: 'socketUnsubscribe', data: SocketUnsubscribeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>): void;
|
|
75
|
+
emit(event: 'warning', data: WarningEvent): void;
|
|
76
|
+
get exchange(): Exchange<TChannel>;
|
|
48
77
|
get isListening(): boolean;
|
|
49
78
|
get isReady(): boolean;
|
|
79
|
+
listen(): DemuxedConsumableStream<StreamEvent<ServerEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>>;
|
|
80
|
+
listen(event: 'close'): DemuxedConsumableStream<CloseEvent>;
|
|
81
|
+
listen(event: 'connection'): DemuxedConsumableStream<ConnectionEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
82
|
+
listen(event: 'error'): DemuxedConsumableStream<ErrorEvent>;
|
|
83
|
+
listen(event: 'handshake'): DemuxedConsumableStream<HandshakeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
84
|
+
listen(event: 'headers'): DemuxedConsumableStream<HeadersEvent>;
|
|
85
|
+
listen(event: 'listening'): DemuxedConsumableStream<ListeningEvent>;
|
|
86
|
+
listen(event: 'ready'): DemuxedConsumableStream<{}>;
|
|
87
|
+
listen(event: 'socketAuthStateChange'): DemuxedConsumableStream<SocketAuthStateChangeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
88
|
+
listen(event: 'socketAuthenticate'): DemuxedConsumableStream<SocketAuthenticateEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
89
|
+
listen(event: 'socketBadAuthToken'): DemuxedConsumableStream<SocketBadAuthTokenEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
90
|
+
listen(event: 'socketClose'): DemuxedConsumableStream<SocketCloseEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
91
|
+
listen(event: 'socketConnect'): DemuxedConsumableStream<SocketConnectEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
92
|
+
listen(event: 'socketConnectAbort'): DemuxedConsumableStream<SocketDisconnectEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
93
|
+
listen(event: 'socketConnecting'): DemuxedConsumableStream<SocketConnectingEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
94
|
+
listen(event: 'socketDeauthenticate'): DemuxedConsumableStream<SocketDeauthenticateEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
95
|
+
listen(event: 'socketDisconnect'): DemuxedConsumableStream<SocketDisconnectEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
96
|
+
listen(event: 'socketError'): DemuxedConsumableStream<SocketErrorEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
97
|
+
listen(event: 'socketMessage'): DemuxedConsumableStream<SocketMessageEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
98
|
+
listen(event: 'socketPing'): DemuxedConsumableStream<SocketPingEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
99
|
+
listen(event: 'socketPong'): DemuxedConsumableStream<SocketPongEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
100
|
+
listen(event: 'socketRemoveAuthToken'): DemuxedConsumableStream<SocketRemoveAuthTokenEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
101
|
+
listen(event: 'socketRequest'): DemuxedConsumableStream<SocketRequestEvent<TService, TIncoming, TPrivateIncoming>>;
|
|
102
|
+
listen(event: 'socketResponse'): DemuxedConsumableStream<SocketResponseEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
103
|
+
listen(event: 'socketSubscribe'): DemuxedConsumableStream<SocketSubscribeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
104
|
+
listen(event: 'socketSubscribeFail'): DemuxedConsumableStream<SocketSubscribeFailEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
105
|
+
listen(event: 'socketSubscribeRequest'): DemuxedConsumableStream<SocketSubscribeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
106
|
+
listen(event: 'socketSubscribeStateChange'): DemuxedConsumableStream<SocketSubscribeStateChangeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
107
|
+
listen(event: 'socketUnsubscribe'): DemuxedConsumableStream<SocketUnsubscribeEvent<TChannel, TService, TIncoming, TOutgoing, TPrivateIncoming, TPrivateOutgoing, TServerState, TState>>;
|
|
108
|
+
listen(event: 'warning'): DemuxedConsumableStream<WarningEvent>;
|
|
50
109
|
private onClose;
|
|
51
110
|
private onConnection;
|
|
52
111
|
private onError;
|
|
@@ -57,63 +116,4 @@ export declare class Server<T extends ServerMap> extends AsyncStreamEmitter<Serv
|
|
|
57
116
|
private startPinging;
|
|
58
117
|
private stopPinging;
|
|
59
118
|
private verifyClient;
|
|
60
|
-
emit(event: "close", data: CloseEvent): void;
|
|
61
|
-
emit(event: "connection", data: ConnectionEvent<T>): void;
|
|
62
|
-
emit(event: "error", data: ErrorEvent): void;
|
|
63
|
-
emit(event: "headers", data: HeadersEvent): void;
|
|
64
|
-
emit(event: "handshake", data: HandshakeEvent<T>): void;
|
|
65
|
-
emit(event: "listening", data: ListeningEvent): void;
|
|
66
|
-
emit(event: "ready", data: {}): void;
|
|
67
|
-
emit(event: 'socketAuthStateChange', data: SocketAuthStateChangeEvent<T>): void;
|
|
68
|
-
emit(event: 'socketAuthenticate', data: SocketAuthenticateEvent<T>): void;
|
|
69
|
-
emit(event: 'socketBadAuthToken', data: SocketBadAuthTokenEvent<T>): void;
|
|
70
|
-
emit(event: 'socketClose', data: SocketCloseEvent<T>): void;
|
|
71
|
-
emit(event: 'socketConnect', data: SocketConnectEvent<T>): void;
|
|
72
|
-
emit(event: 'socketConnectAbort', data: SocketDisconnectEvent<T>): void;
|
|
73
|
-
emit(event: 'socketConnecting', data: SocketConnectingEvent<T>): void;
|
|
74
|
-
emit(event: 'socketDeauthenticate', data: SocketDeauthenticateEvent<T>): void;
|
|
75
|
-
emit(event: 'socketDisconnect', data: SocketDisconnectEvent<T>): void;
|
|
76
|
-
emit(event: 'socketError', data: SocketErrorEvent<T>): void;
|
|
77
|
-
emit(event: 'socketMessage', data: SocketMessageEvent<T>): void;
|
|
78
|
-
emit(event: 'socketPing', data: SocketPingEvent<T>): void;
|
|
79
|
-
emit(event: 'socketPong', data: SocketPongEvent<T>): void;
|
|
80
|
-
emit(event: 'socketRemoveAuthToken', data: SocketRemoveAuthTokenEvent<T>): void;
|
|
81
|
-
emit(event: 'socketRequest', data: SocketRequestEvent<T>): void;
|
|
82
|
-
emit(event: 'socketResponse', data: SocketResponseEvent<T>): void;
|
|
83
|
-
emit(event: 'socketSubscribe', data: SocketSubscribeEvent<T>): void;
|
|
84
|
-
emit(event: 'socketSubscribeFail', data: SocketSubscribeFailEvent<T>): void;
|
|
85
|
-
emit(event: 'socketSubscribeRequest', data: SocketSubscribeEvent<T>): void;
|
|
86
|
-
emit(event: 'socketSubscribeStateChange', data: SocketSubscribeStateChangeEvent<T>): void;
|
|
87
|
-
emit(event: 'socketUnsubscribe', data: SocketUnsubscribeEvent<T>): void;
|
|
88
|
-
emit(event: "warning", data: WarningEvent): void;
|
|
89
|
-
listen(): DemuxedConsumableStream<StreamEvent<ServerEvent<T>>>;
|
|
90
|
-
listen(event: "close"): DemuxedConsumableStream<CloseEvent>;
|
|
91
|
-
listen(event: "connection"): DemuxedConsumableStream<ConnectionEvent<T>>;
|
|
92
|
-
listen(event: "error"): DemuxedConsumableStream<ErrorEvent>;
|
|
93
|
-
listen(event: "handshake"): DemuxedConsumableStream<HandshakeEvent<T>>;
|
|
94
|
-
listen(event: "headers"): DemuxedConsumableStream<HeadersEvent>;
|
|
95
|
-
listen(event: "listening"): DemuxedConsumableStream<ListeningEvent>;
|
|
96
|
-
listen(event: "ready"): DemuxedConsumableStream<{}>;
|
|
97
|
-
listen(event: 'socketAuthStateChange'): DemuxedConsumableStream<SocketAuthStateChangeEvent<T>>;
|
|
98
|
-
listen(event: 'socketAuthenticate'): DemuxedConsumableStream<SocketAuthenticateEvent<T>>;
|
|
99
|
-
listen(event: 'socketBadAuthToken'): DemuxedConsumableStream<SocketBadAuthTokenEvent<T>>;
|
|
100
|
-
listen(event: 'socketClose'): DemuxedConsumableStream<SocketCloseEvent<T>>;
|
|
101
|
-
listen(event: 'socketConnect'): DemuxedConsumableStream<SocketConnectEvent<T>>;
|
|
102
|
-
listen(event: 'socketConnectAbort'): DemuxedConsumableStream<SocketDisconnectEvent<T>>;
|
|
103
|
-
listen(event: 'socketConnecting'): DemuxedConsumableStream<SocketConnectingEvent<T>>;
|
|
104
|
-
listen(event: 'socketDeauthenticate'): DemuxedConsumableStream<SocketDeauthenticateEvent<T>>;
|
|
105
|
-
listen(event: 'socketDisconnect'): DemuxedConsumableStream<SocketDisconnectEvent<T>>;
|
|
106
|
-
listen(event: 'socketError'): DemuxedConsumableStream<SocketErrorEvent<T>>;
|
|
107
|
-
listen(event: 'socketMessage'): DemuxedConsumableStream<SocketMessageEvent<T>>;
|
|
108
|
-
listen(event: 'socketPing'): DemuxedConsumableStream<SocketPingEvent<T>>;
|
|
109
|
-
listen(event: 'socketPong'): DemuxedConsumableStream<SocketPongEvent<T>>;
|
|
110
|
-
listen(event: 'socketRemoveAuthToken'): DemuxedConsumableStream<SocketRemoveAuthTokenEvent<T>>;
|
|
111
|
-
listen(event: 'socketRequest'): DemuxedConsumableStream<SocketRequestEvent<T>>;
|
|
112
|
-
listen(event: 'socketResponse'): DemuxedConsumableStream<SocketResponseEvent<T>>;
|
|
113
|
-
listen(event: 'socketSubscribe'): DemuxedConsumableStream<SocketSubscribeEvent<T>>;
|
|
114
|
-
listen(event: 'socketSubscribeFail'): DemuxedConsumableStream<SocketSubscribeFailEvent<T>>;
|
|
115
|
-
listen(event: 'socketSubscribeRequest'): DemuxedConsumableStream<SocketSubscribeEvent<T>>;
|
|
116
|
-
listen(event: 'socketSubscribeStateChange'): DemuxedConsumableStream<SocketSubscribeStateChangeEvent<T>>;
|
|
117
|
-
listen(event: 'socketUnsubscribe'): DemuxedConsumableStream<SocketUnsubscribeEvent<T>>;
|
|
118
|
-
listen(event: "warning"): DemuxedConsumableStream<WarningEvent>;
|
|
119
119
|
}
|
package/dist/server.js
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { authenticateHandler } from
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { AsyncStreamEmitter } from '@socket-mesh/async-stream-emitter';
|
|
2
|
+
import { defaultAuthEngine, isAuthEngine } from '@socket-mesh/auth-engine';
|
|
3
|
+
import { removeAuthTokenHandler } from '@socket-mesh/client';
|
|
4
|
+
import { ServerProtocolError } from '@socket-mesh/errors';
|
|
5
|
+
import defaultCodec from '@socket-mesh/formatter';
|
|
6
|
+
import { WebSocketServer } from 'ws';
|
|
7
|
+
import { SimpleBroker } from './broker/simple-broker.js';
|
|
8
|
+
import { authenticateHandler } from './handlers/authenticate.js';
|
|
9
|
+
import { handshakeHandler } from './handlers/handshake.js';
|
|
10
|
+
import { publishHandler } from './handlers/publish.js';
|
|
11
|
+
import { subscribeHandler } from './handlers/subscribe.js';
|
|
12
|
+
import { unsubscribeHandler } from './handlers/unsubscribe.js';
|
|
13
|
+
import { ServerSocket } from './server-socket.js';
|
|
14
14
|
export class Server extends AsyncStreamEmitter {
|
|
15
|
+
_callIdGenerator;
|
|
16
|
+
_handlers;
|
|
17
|
+
_isListening;
|
|
18
|
+
_isReady;
|
|
19
|
+
_pingIntervalRef;
|
|
20
|
+
_wss;
|
|
21
|
+
// | ServerSocket<TIncomingMap, TServiceMap, TOutgoingMap, TPrivateIncomingMap, TPrivateOutgoingMap, TServerState, TSocketState>
|
|
22
|
+
ackTimeoutMs;
|
|
23
|
+
allowClientPublish;
|
|
24
|
+
auth;
|
|
25
|
+
brokerEngine;
|
|
26
|
+
clientCount;
|
|
27
|
+
clients;
|
|
28
|
+
codecEngine;
|
|
29
|
+
httpServer;
|
|
30
|
+
isPingTimeoutDisabled;
|
|
31
|
+
origins;
|
|
32
|
+
pendingClientCount;
|
|
33
|
+
pendingClients;
|
|
34
|
+
pingIntervalMs;
|
|
35
|
+
pingTimeoutMs;
|
|
36
|
+
plugins;
|
|
37
|
+
socketChannelLimit;
|
|
38
|
+
socketStreamCleanupMode;
|
|
39
|
+
strictHandshake;
|
|
15
40
|
constructor(options) {
|
|
16
41
|
super();
|
|
17
42
|
let cid = 1;
|
|
@@ -30,12 +55,12 @@ export class Server extends AsyncStreamEmitter {
|
|
|
30
55
|
this.clientCount = 0;
|
|
31
56
|
this.codecEngine = options.codecEngine || defaultCodec;
|
|
32
57
|
this._handlers = Object.assign({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
58
|
+
'#authenticate': authenticateHandler,
|
|
59
|
+
'#handshake': handshakeHandler,
|
|
60
|
+
'#publish': publishHandler,
|
|
61
|
+
'#removeAuthToken': removeAuthTokenHandler,
|
|
62
|
+
'#subscribe': subscribeHandler,
|
|
63
|
+
'#unsubscribe': unsubscribeHandler
|
|
39
64
|
}, options.handlers);
|
|
40
65
|
this.httpServer = options.server;
|
|
41
66
|
this.plugins = options.plugins || [];
|
|
@@ -49,14 +74,14 @@ export class Server extends AsyncStreamEmitter {
|
|
|
49
74
|
this.socketStreamCleanupMode = options.socketStreamCleanupMode || 'kill';
|
|
50
75
|
this.strictHandshake = options.strictHandshake ?? true;
|
|
51
76
|
options.verifyClient = this.verifyClient.bind(this);
|
|
52
|
-
this._wss = new
|
|
77
|
+
this._wss = new WebSocketServer(options);
|
|
53
78
|
this._wss.on('close', this.onClose.bind(this));
|
|
54
79
|
this._wss.on('connection', this.onConnection.bind(this));
|
|
55
80
|
this._wss.on('error', this.onError.bind(this));
|
|
56
81
|
this._wss.on('headers', this.onHeaders.bind(this));
|
|
57
82
|
this._wss.on('listening', this.onListening.bind(this));
|
|
58
83
|
(async () => {
|
|
59
|
-
for await (
|
|
84
|
+
for await (const { error } of this.brokerEngine.listen('error')) {
|
|
60
85
|
this.emit('warning', { warning: error });
|
|
61
86
|
}
|
|
62
87
|
})();
|
|
@@ -80,34 +105,34 @@ export class Server extends AsyncStreamEmitter {
|
|
|
80
105
|
}
|
|
81
106
|
bind(socket) {
|
|
82
107
|
/*
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
106
|
-
})();
|
|
108
|
+
if (socket.type === 'client') {
|
|
109
|
+
(async () => {
|
|
110
|
+
for await (let event of socket.listen()) {
|
|
111
|
+
this.emit(
|
|
112
|
+
`socket${event.stream[0].toUpperCase()}${event.stream.substring(1)}` as any,
|
|
113
|
+
Object.assign(
|
|
114
|
+
{ socket },
|
|
115
|
+
event.value
|
|
116
|
+
)
|
|
117
|
+
);
|
|
118
|
+
}
|
|
119
|
+
})();
|
|
120
|
+
|
|
121
|
+
(async () => {
|
|
122
|
+
for await (let event of socket.channels.listen()) {
|
|
123
|
+
this.emit(
|
|
124
|
+
`socket${event.stream[0].toUpperCase()}${event.stream.substring(1)}` as any,
|
|
125
|
+
Object.assign(
|
|
126
|
+
{ socket },
|
|
127
|
+
event.value
|
|
128
|
+
)
|
|
129
|
+
);
|
|
107
130
|
}
|
|
108
|
-
|
|
131
|
+
})();
|
|
132
|
+
}
|
|
133
|
+
*/
|
|
109
134
|
(async () => {
|
|
110
|
-
for await (
|
|
135
|
+
for await (const _ of socket.listen('connect')) {
|
|
111
136
|
if (this.pendingClients[socket.id]) {
|
|
112
137
|
delete this.pendingClients[socket.id];
|
|
113
138
|
this.pendingClientCount--;
|
|
@@ -118,12 +143,12 @@ export class Server extends AsyncStreamEmitter {
|
|
|
118
143
|
}
|
|
119
144
|
})();
|
|
120
145
|
(async () => {
|
|
121
|
-
for await (
|
|
146
|
+
for await (const _ of socket.listen('connectAbort')) {
|
|
122
147
|
this.socketDisconnected(socket);
|
|
123
148
|
}
|
|
124
149
|
})();
|
|
125
150
|
(async () => {
|
|
126
|
-
for await (
|
|
151
|
+
for await (const _ of socket.listen('disconnect')) {
|
|
127
152
|
this.socketDisconnected(socket);
|
|
128
153
|
}
|
|
129
154
|
})();
|
|
@@ -139,12 +164,15 @@ export class Server extends AsyncStreamEmitter {
|
|
|
139
164
|
resolve();
|
|
140
165
|
});
|
|
141
166
|
if (!keepSocketsOpen) {
|
|
142
|
-
for (
|
|
167
|
+
for (const socket of Object.values(this.clients)) {
|
|
143
168
|
socket.disconnect();
|
|
144
169
|
}
|
|
145
170
|
}
|
|
146
171
|
});
|
|
147
172
|
}
|
|
173
|
+
emit(event, data) {
|
|
174
|
+
super.emit(event, data);
|
|
175
|
+
}
|
|
148
176
|
get exchange() {
|
|
149
177
|
return this.brokerEngine.exchange;
|
|
150
178
|
}
|
|
@@ -154,32 +182,35 @@ export class Server extends AsyncStreamEmitter {
|
|
|
154
182
|
get isReady() {
|
|
155
183
|
return this._isReady;
|
|
156
184
|
}
|
|
185
|
+
listen(event) {
|
|
186
|
+
return event ? super.listen(event) : super.listen();
|
|
187
|
+
}
|
|
157
188
|
onClose(code, reason) {
|
|
158
189
|
this.emit('close', {});
|
|
159
190
|
}
|
|
160
191
|
onConnection(wsSocket, upgradeReq) {
|
|
161
192
|
/*
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
193
|
+
if (!wsSocket.upgradeReq) {
|
|
194
|
+
// Normalize ws modules to match.
|
|
195
|
+
wsSocket.upgradeReq = upgradeReq;
|
|
196
|
+
}
|
|
197
|
+
*/
|
|
167
198
|
const socket = new ServerSocket({
|
|
168
199
|
ackTimeoutMs: this.ackTimeoutMs,
|
|
169
200
|
callIdGenerator: this._callIdGenerator,
|
|
170
201
|
codecEngine: this.codecEngine,
|
|
171
202
|
handlers: this._handlers,
|
|
172
|
-
plugins: this.plugins,
|
|
173
203
|
onUnhandledRequest: this.onUnhandledRequest.bind(this),
|
|
204
|
+
plugins: this.plugins,
|
|
174
205
|
request: upgradeReq,
|
|
175
|
-
socket: wsSocket,
|
|
176
206
|
server: this,
|
|
207
|
+
socket: wsSocket,
|
|
177
208
|
state: {},
|
|
178
209
|
streamCleanupMode: this.socketStreamCleanupMode
|
|
179
210
|
});
|
|
180
211
|
this.pendingClientCount++;
|
|
181
212
|
this.bind(this.pendingClients[socket.id] = socket);
|
|
182
|
-
//
|
|
213
|
+
// ws.on('error', console.error);
|
|
183
214
|
this.emit('connection', { socket, upgradeReq });
|
|
184
215
|
// Emit event to signal that a socket handshake has been initiated.
|
|
185
216
|
this.emit('handshake', { socket });
|
|
@@ -200,11 +231,11 @@ export class Server extends AsyncStreamEmitter {
|
|
|
200
231
|
onUnhandledRequest(socket, packet) {
|
|
201
232
|
}
|
|
202
233
|
socketDisconnected(socket) {
|
|
203
|
-
if (
|
|
234
|
+
if (this.pendingClients[socket.id]) {
|
|
204
235
|
delete this.pendingClients[socket.id];
|
|
205
236
|
this.pendingClientCount--;
|
|
206
237
|
}
|
|
207
|
-
if (
|
|
238
|
+
if (this.clients[socket.id]) {
|
|
208
239
|
delete this.clients[socket.id];
|
|
209
240
|
this.clientCount--;
|
|
210
241
|
}
|
|
@@ -218,7 +249,7 @@ export class Server extends AsyncStreamEmitter {
|
|
|
218
249
|
for (const id in this.clients) {
|
|
219
250
|
this.clients[id]
|
|
220
251
|
.ping()
|
|
221
|
-
.catch(err => {
|
|
252
|
+
.catch((err) => {
|
|
222
253
|
this.onError(err);
|
|
223
254
|
});
|
|
224
255
|
}
|
|
@@ -237,16 +268,18 @@ export class Server extends AsyncStreamEmitter {
|
|
|
237
268
|
info.origin = '*';
|
|
238
269
|
}
|
|
239
270
|
if (this.origins.indexOf('*:*') === -1) {
|
|
240
|
-
let
|
|
271
|
+
let isOk = false;
|
|
241
272
|
try {
|
|
242
273
|
const url = new URL(info.origin);
|
|
243
274
|
url.port = url.port || (url.protocol === 'https:' ? '443' : '80');
|
|
244
|
-
|
|
245
|
-
~this.origins.indexOf(url.hostname + ':*')
|
|
246
|
-
~this.origins.indexOf('*:' + url.port));
|
|
275
|
+
isOk = !!(~this.origins.indexOf(url.hostname + ':' + url.port)
|
|
276
|
+
|| ~this.origins.indexOf(url.hostname + ':*')
|
|
277
|
+
|| ~this.origins.indexOf('*:' + url.port));
|
|
278
|
+
}
|
|
279
|
+
catch (e) {
|
|
280
|
+
// Intentional
|
|
247
281
|
}
|
|
248
|
-
|
|
249
|
-
if (!ok) {
|
|
282
|
+
if (!isOk) {
|
|
250
283
|
const error = new ServerProtocolError(`Failed to authorize socket handshake - Invalid origin: ${info.origin}`);
|
|
251
284
|
this.emit('warning', { warning: error });
|
|
252
285
|
callback(false, 403, error.message);
|
|
@@ -272,10 +305,4 @@ export class Server extends AsyncStreamEmitter {
|
|
|
272
305
|
callback(false, 403, typeof err === 'string' ? err : err.message);
|
|
273
306
|
}
|
|
274
307
|
}
|
|
275
|
-
emit(event, data) {
|
|
276
|
-
super.emit(event, data);
|
|
277
|
-
}
|
|
278
|
-
listen(event) {
|
|
279
|
-
return super.listen(event);
|
|
280
|
-
}
|
|
281
308
|
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,72 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socket-mesh/server",
|
|
3
3
|
"description": "A TCP socket pair for easily transmitting full messages without worrying about request size limits.",
|
|
4
|
-
"version": "18.1.
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
"version": "18.1.5",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"files": ["./dist"],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./broker": {
|
|
16
|
+
"types": "./dist/broker/index.d.ts",
|
|
17
|
+
"import": "./dist/broker/index.js",
|
|
18
|
+
"default": "./dist/broker/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./events": {
|
|
21
|
+
"types": "./dist/events/index.d.ts",
|
|
22
|
+
"import": "./dist/events/index.js",
|
|
23
|
+
"default": "./dist/events/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./handlers": {
|
|
26
|
+
"types": "./dist/handlers/index.d.ts",
|
|
27
|
+
"import": "./dist/handlers/index.js",
|
|
28
|
+
"default": "./dist/handlers/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
9
31
|
"author": {
|
|
10
32
|
"name": "Greg Kimmy"
|
|
11
33
|
},
|
|
12
34
|
"scripts": {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
35
|
+
"build": "node ../../scripts/build.mjs && tsc --project tsconfig.build.json",
|
|
36
|
+
"deploy": "node ../../scripts/publish.mjs",
|
|
37
|
+
"lint": "eslint . --c ../../eslint.config.mjs",
|
|
38
|
+
"lint:fix": "eslint . --c ../../eslint.config.mjs --fix",
|
|
39
|
+
"test": "tsx --tsconfig ./tsconfig.build.json --test ./src/**/*.{spec,test}.ts ./test/**/*.{spec,test}.ts"
|
|
40
|
+
},
|
|
41
|
+
"repository": {
|
|
42
|
+
"type": "git",
|
|
43
|
+
"url": "git+https://github.com/socket-mesh/client-server.git"
|
|
16
44
|
},
|
|
17
|
-
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/socket-mesh/client-server.git"
|
|
20
|
-
},
|
|
21
|
-
"bugs": {
|
|
45
|
+
"bugs": {
|
|
22
46
|
"url": "https://github.com/socket-mesh/client-server/labels/server"
|
|
23
|
-
|
|
47
|
+
},
|
|
24
48
|
"devDependencies": {
|
|
25
|
-
"@socket-mesh/local-storage": "
|
|
26
|
-
"@
|
|
27
|
-
"@types/
|
|
28
|
-
"@types/
|
|
49
|
+
"@socket-mesh/local-storage": "workspace:^",
|
|
50
|
+
"@socket-mesh/typescript-config": "workspace:^",
|
|
51
|
+
"@types/base64id": "catalog:base64id",
|
|
52
|
+
"@types/jsonwebtoken": "catalog:json-web-token",
|
|
53
|
+
"@types/ws": "catalog:ws"
|
|
29
54
|
},
|
|
30
55
|
"dependencies": {
|
|
31
|
-
"@socket-mesh/async-stream-emitter": "
|
|
32
|
-
"@socket-mesh/auth": "
|
|
33
|
-
"@socket-mesh/auth-engine": "
|
|
34
|
-
"@socket-mesh/
|
|
35
|
-
"@socket-mesh/
|
|
36
|
-
"@socket-mesh/
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
56
|
+
"@socket-mesh/async-stream-emitter": "workspace:^",
|
|
57
|
+
"@socket-mesh/auth": "workspace:^",
|
|
58
|
+
"@socket-mesh/auth-engine": "workspace:^",
|
|
59
|
+
"@socket-mesh/channels": "workspace:^",
|
|
60
|
+
"@socket-mesh/client": "workspace:^",
|
|
61
|
+
"@socket-mesh/core": "workspace:^",
|
|
62
|
+
"@socket-mesh/errors": "workspace:^",
|
|
63
|
+
"@socket-mesh/formatter": "workspace:^",
|
|
64
|
+
"@socket-mesh/stream-demux": "workspace:^",
|
|
65
|
+
"@socket-mesh/writable-consumable-stream": "workspace:^",
|
|
66
|
+
"base64id": "catalog:base64id",
|
|
67
|
+
"events": "catalog:",
|
|
68
|
+
"jsonwebtoken": "catalog:json-web-token",
|
|
69
|
+
"ws": "catalog:ws"
|
|
41
70
|
},
|
|
42
71
|
"keywords": [
|
|
43
72
|
"ncom",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { PublicMethodMap } from "@socket-mesh/core";
|
|
2
|
-
import { ServerMap } from "./server-map.js";
|
|
3
|
-
export interface ClientMapFromServer<T extends ServerMap> {
|
|
4
|
-
Channel: T['Channel'];
|
|
5
|
-
Incoming: T['Outgoing'] & T['PrivateOutgoing'];
|
|
6
|
-
Service: T['Service'];
|
|
7
|
-
Outgoing: PublicMethodMap;
|
|
8
|
-
PrivateOutgoing: T['PrivateIncoming'];
|
|
9
|
-
State: object;
|
|
10
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ChannelMap } from "@socket-mesh/channels";
|
|
2
|
-
import { ClientPrivateMap, ServerPrivateMap } from "@socket-mesh/client";
|
|
3
|
-
import { PrivateMethodMap, PublicMethodMap, ServiceMap } from "@socket-mesh/core";
|
|
4
|
-
import { ServerSocketState } from "../server-socket-state.js";
|
|
5
|
-
export interface ServerMap {
|
|
6
|
-
Channel: ChannelMap;
|
|
7
|
-
Service: ServiceMap;
|
|
8
|
-
Incoming: PublicMethodMap;
|
|
9
|
-
Outgoing: PublicMethodMap;
|
|
10
|
-
PrivateIncoming: PrivateMethodMap;
|
|
11
|
-
PrivateOutgoing: PrivateMethodMap;
|
|
12
|
-
ServerState: object;
|
|
13
|
-
State: object;
|
|
14
|
-
}
|
|
15
|
-
export interface BasicServerMap<TIncoming extends PublicMethodMap = {}, TChannels extends ChannelMap = {}, TState extends object = {}, TOutgoing extends object = {}> {
|
|
16
|
-
Channel: TChannels;
|
|
17
|
-
Service: {};
|
|
18
|
-
Incoming: TIncoming;
|
|
19
|
-
Outgoing: TOutgoing;
|
|
20
|
-
PrivateIncoming: ServerPrivateMap;
|
|
21
|
-
PrivateOutgoing: ClientPrivateMap;
|
|
22
|
-
ServerState: {};
|
|
23
|
-
State: TState & ServerSocketState;
|
|
24
|
-
}
|