Skip to content

Conversation

DudaGod
Copy link
Member

@DudaGod DudaGod commented Jul 3, 2019

No description provided.

README.md Outdated

### Listening for websocket proxy request events

* `clientSender`: This event is emitted after websocket sender from client to server is initialized
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

почему не clientReady или clientInited?

Copy link
Member Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

событие clientSender ни о чем не говорит. Что clientSender? появился, завершился?

Copy link
Member Author

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) => {
Copy link
Member

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');
});

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Очень красиво, но не понятно )

@DudaGod DudaGod force-pushed the dd.emit_ws_senders branch from 47c03a4 to 136f4a5 Compare July 3, 2019 16:52
@DudaGod DudaGod merged commit 3f009b0 into master Jul 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants