feat: add netty WebSocket client

Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
2020-12-17 17:00:27 +08:00
parent f42d5d12ed
commit 48cc6325b8
6 changed files with 400 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
export interface WebSocketHeader {
[key: string]: string
}
export type EventType =
| 'close'
| 'error'
| 'message'
| 'open'
export interface Event {
}
export interface MessageEvent extends Event {
data: any
origin?: string
lastEventId?: string
source?: string
ports?: string
}
export interface ErrorEvent extends Event {
error: Error
}
export interface CloseEvent extends Event {
code: number
reason: string
}