A
A
Alex2022-02-10 15:58:18
JavaScript
Alex, 2022-02-10 15:58:18

How to remove sid from url in socket.io?

Known problem of passing sid in query string in socket.io, found a lot of discussions on this topic, but did not find a solution. The task is to remove this parameter from the url in order to pass the check. Does anyone have any solutions, or will I have to use another library for web sockets?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex, 2022-02-10
@2891535

I answer my own question) By default , and if you do this:transports: ["polling", "websocket"]

const socket = io("https://example.com", { transports: ["websocket"] });

then sid will be transmitted over the web socket, and not in the get parameter

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question