Skip to content

Nginx + Socket.io + Nodejs: How to configure socket.io on custom path (getting transport error - isTrusted:true) #4527

Answered by peppies
peppies asked this question in Q&A
Discussion options

You must be logged in to vote

After banging my head against the wall and a little bit of trial/error luck, I got everything working by changing the client-side script to:

<script>
  var socket = io('https://www.*************.com', {path: "/cnode2", transports: ['websocket','polling']});
</script>

It seems that the "path" has to match the "path" set on the server-side app config.

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by peppies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants