B
B
BestJS2017-03-22 12:27:34
Node.js
BestJS, 2017-03-22 12:27:34

How can you handle the opening of a WebSocket(socket.io), even before the opening?

As I understand it, it opens like this:
https://yadi.sk/i/0rvevjKf3GEhL2
1) First, an ajax request is sent.
2) After that, WS opens.
I want to make protection by ip so that it would be impossible to create 2 websockets from one ip.
Done like this:
io.use( and handler function)
but at this point ws is already open.
Is there a means in socket io to set the number of ws from one ip or to process the first ajax request?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vitaly, 2017-03-22
@vshvydky

Haven't heard of nat at all? Now a lot of users on the network are sitting from 1 address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question