Can someone point me to how i would add a Socket IO Client to my javascript web application to be informed when topical activity occurs within select NodeBB categories
Solved
Technical Support
-
Maybe try changing "url" in your config.json to
http://127.0.0.1:4567
If you provide a cors in config.json it should be an object that gets passed to socket.io so something like.
"socket.io": { "cors": { origin: "http://127.0.0.1:*", methods: ['GET', 'POST'], allowedHeaders: ['content-type'], } }
-
@baris In your "allowedHeaders" field, do I use the words 'content-type' .. or does this need to be replaced with some value
-
That field is passed to https://github.com/expressjs/cors#configuration-options, you might be able to just leave it out
If not specified, defaults to reflecting the headers specified in the request's Access-Control-Request-Headers header.
Did you try changing your url field in config.json to
http://127.0.0.1:4567
? And change the connection code to also use127.0.0.1:4567
instead of localhost. -
Copyright © 2024 NodeBB | Contributors