I have nodejs websocket server hosted on azure.
websocket client was build by react.
websocket is working well on my local.
but after hosted on azure server, I can't connect to there.
can anyone help me to solve this issue.
Thank you in advance.
Related
I have an express node server running that is a backend for a REST API and a Websockets (for chatting feature) while my client is React.js
When I deploy my server to an AWS EC2 instance with security groups set up, I am able to make http api calls, but my socket.io connection doesn't work. I have tested the server locally on my localhost, which works.
I think this does something with the proxy in the package.json because testing locally when I change the proxy to my EC2 instance public ip while keeping my socket.io connection connected to my localhost it does not work.
I am not getting any "connection refused" errors.
So my question is how does the react.js proxy effect the socket.io connection?
I created and deployed a MERN web app on DigitalOcean which works fine using a Mongo database hosted on mlab.com, but now I want to host the database on DigitalOcean and I'm having difficulties with this...
I followed this tutorial https://www.digitalocean.com/community/tutorials/how-to-install-mongodb-on-ubuntu-16-04 but now I don't know how to connect my node.js server to this database.
Does the connection to 127.0.0.1:27017/mydbname should work on production?
Any solution or advice would help me a lot.
Does anybody know how to create and configure AWS so that I can deploy a simple Node.js WebSocket server on it?
I am attempting to connect to a Socket.IO server hosted in the extension folder of my Azure Mobile service using the startup script, although I am unable to do so, and receive the error:
"WebSocket connection to 'ws://mymobileservice.azure-mobile.net/extensions/socket.io/?EIO=2&transport=websocket' failed: Error during WebSocket handshake: Unexpected response code: 503"
I am using port 80 with a path of 'extensions/socket.io'
I've also used port 443 with a secure connection, and that has yielded the same error.
Am I on the right track?
Any help is greatly appreciated.
You figured this out, but here's a definitive answer.
The best way to host a socket.io server is to host it on Azure Websites directly (Azure > New > Website) instead of Azure Mobile Services. Once you publish your socket IO server to the website, don't forget to go to the "Configure" tab and enable "Websockets" for the server.
There is an amazing tutorial on deploying the socket.io chat app to azure websites here:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-nodejs-chat-app-socketio/
I am using Node.js + Socket.io in my application.
Say, my chat application (php) is hosted on server A and node.js is hosted on AWS.
Each client accesses chat application and in the background it registers the client with the node.js application hosted on AWS.
The problem is when I use a proxy server from hidemyass.com and configure my firefox to access the application.
The application is loading but it unable to connect to node server hosted on AWS and I get a 403 Forbidden error.
Is this a problem with AWS security configuration or a node.js settings ? I am unable to figure this at all.
I have tried my best to search for reasons why this would happen, but didn't get any clue. Can it be an AWS configuration issues or Is it to do with Nodejs server settings. Any guess or help is highly appreciated.
Thanks you very much.