Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,934 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I created a chat application using node js and socket.io . My application worked fine on local host but after deploying only the http request and endpoints are working . I cant connect to my socket connection . Is there any way to make it right without using azure pubsub ?
@Juman Das It sounds like you’re facing a common issue with Socket.IO when deploying to a production environment. Lets see if we can troubleshoot this together:
Check Server Configuration:
curl
command: curl
const
Enable CORS:
- If your client and server are on different domains, you might need to configure CORS (Cross-Origin Resource Sharing) on your server:
```javascript
const
```
**Check for Errors**:
- Use the `connect_error` event on the client side to get more information about why the connection is failing:
```javascript
socket.
```
- Similarly, on the server side, you can listen for `connection_error` events:
```javascript
io.
```
const
These steps should help you diagnose and fix the connection issue with your Socket.IO application.