-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: ability to subscribe on websocket client/server senders #4
Conversation
README.md
Outdated
@@ -489,6 +487,39 @@ proxy.on('close', function (res, socket, head) { | |||
|
|||
**[Back to top](#table-of-contents)** | |||
|
|||
### Listening for websocket proxy request events | |||
|
|||
* `clientSender`: This event is emitted after websocket sender from client to server is initialized |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
почему не clientReady
или clientInited
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
потому что websocket класс, который я использую называется Sender
и кроме него у клиента и у сервера есть еще Receiver
. Класс sender отвечает за отправку данных, поэтому так и назвал, чтобы никого не путать.
Sender - https://github.com/websockets/ws/blob/1.1.4/lib/Sender.js
Receiver - https://github.com/websockets/ws/blob/1.1.4/lib/Receiver.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
событие clientSender
ни о чем не говорит. Что clientSender? появился, завершился?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
переименовал в clientSenderInited
и serverSenderInited
README.md
Outdated
}); | ||
|
||
proxyServer.on('proxyReqWs', (proxyReq, req, socket, options, head) => { | ||
proxyReq.on('clientSender', (clientSender) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
и в примере красиво будет:
proxyReq.on('clientInited', (client) => {
client.send('hello from client');
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Очень красиво, но не понятно )
47c03a4
to
136f4a5
Compare
No description provided.