405 HTTP method GET is not supported by this URL

pavi_elex8 years ago

I am not able to locate my device on the map. It is connected successfully because it is updating time after some interval but it is not visible on the map.

When I click on the device, it gives me following error in console
405 HTTP method GET is not supported by this URL

It is unable to handshake with ws://domain/api/socket

Please help to solve this issue.

thank You

Anton Tananaev8 years ago

It looks like websocket is blocked somewhere. Possibly by your internet provider.

pavi_elex8 years ago

Thanks for your reply.

I got reason of the problem but not the solution.
When I open traccar server using url http://192.168.0.10:8082 (192.168.0.10 is my local IP), I do not get this issue and it clearly shows my device on the map but when I use domain or public IP, I am not able to locate my device on the map, I get same issue. It must be a open port problem, all ports are opened locally so I do not get the issue but only 5055 and 80 is opened publically that's why I get this issue.

Can you please suggest which other port should be opened publically so I can view my device on the map outside LAN.

Thanks

Anton Tananaev8 years ago

How do you get from external port 80 to internal 8082?

pavi_elex8 years ago

I have resolved it in apache virtual host using proxypass.
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://localhost:8082/
ProxyPassReverse / http://localhost:8082/
ServerName domainname
</VirtualHost>

Now when I open url http://domainname, it opens traccar server UI.

One more thing, I have opened port 8082, so it is working on url http://publicIP:8082 just like my internal urls http://localhost:8082 or http://192.168.0.10:8082
So atleast it can be opened outside LAN using publicIP with port, but this is not user friendly, I can't give url with IP and ports to my friends because it is little technical that's why I want it to work with domain.
Can you please tell, how did you manage it for http://demo.traccar.org

Thank you

Anton Tananaev8 years ago

It looks like you don't proxy WebSockets. You can find example of how to configure it here:

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

pavi_elex8 years ago

worked like a charm.

Thank you so much

Just want to mention here that need to clear cache as the error was related to js.

Thanks again.