Issue with the web socket

Dijo Jose4 years ago

We installed traccar in an ip like xx.xx.xx.xx:8082 and using domain for the UI like www.mydomain.com. But when we call websocket from the domain its showing like "Error during WebSocket handshake: Unexpected response code: 503" . Can you please help to solve this issue.

Anton Tananaev4 years ago

How are you using domain?

Dijo Jose4 years ago

In same server we hosted associated application in Apache. And hence the domain name will hit the server. But Apache listens port 80 only.

DNS server resolve ip address of my traccar server.

But domain:8082 is not working

Anton Tananaev4 years ago

Sounds like you have an Apache proxy. Have you configured websocket proxy as well?

Anders Yuran4 years ago

It must look like this.

 ProxyPass /api/socket ws://localhost:8082/api/socket
 ProxyPassReverse /api/socket ws://localhost:8082/api/socket

                ProxyPass / http://localhost:8082/
                ProxyPassReverse / http://localhost:8082/
Murthy Varanasi3 years ago

any sample code pls ,I am a dummy in this scenerio

Anton Tananaev3 years ago

What code are you talking about?

Murthy Varanasi3 years ago

the proxypass abt apache

Anton Tananaev3 years ago

You don't need to write any code. You just need to configure it. We have a documentation page for it:

https://www.traccar.org/secure-connection/

I'm sure there's also countless guides online on how to set it up. It's not something Traccar specific.

Murthy Varanasi3 years ago

but aws doesnt it us configure https for elasticip

Anton Tananaev3 years ago

You need a domain name to have valid HTTPS, but I don't think it's relevant to the question.

Murthy Varanasi3 years ago

Actually I found it relevant because i saw few using aws and it does'nt give https,but as i see web socket needs https. so any way around

Anton Tananaev3 years ago

WebSocket doesn't need HTTPS. Not sure where you saw it, but it's incorrect assumption.