Upcoming Games

(UTC times)


Full list
Add a game

Upcoming Events

No events to display

Cannot connect with stompjs

You are here: Home > Forum > Customising SimSig > Interface Gateway > Cannot connect with stompjs

Page 1 of 1

Cannot connect with stompjs Yesterday at 10:19 #161150
DanHowe0
Avatar
4 posts
Hi all, I am attempting to create a website which just displays some information about the sim via the information gateway. I have almost no experience with JS as I am a Python guy myself however I thought I would give it a go. The code does attempt to connect as it takes about 2-3 mins for the connection to fail , whereas it fails instantly when the game is not running. I think the issue may be with the URL used as I have to provide it as `ws://xx.xxx.xxx.xx:port` and with my python projects on this case I have never had to use the `ws://`.
Any ideas why it wont connect?

Log in to reply
Cannot connect with stompjs Yesterday at 11:49 #161153
jonathanp
Avatar
23 posts
Note the description of the library: "This library allows you to connect to a STOMP broker over WebSocket."

You are trying to connect to a websocket, which is a way of tunnelling long running connections over HTTP, but SimSig is a not a HTTP server and accepts STOMP connection only over raw TCP sockets.

You will not be able to connect directly to SimSig from a web page. Web Browsers do not allow raw TCP connections for security reasons. So either you need to find some software which will provide a websocket server and proxy the traffic to a raw TCP connection, or develop your own backend server(in Python perhaps!) which connects to SimSig and then can be queried via HTTP.

Last edited: Yesterday at 11:55 by jonathanp
Reason: None given

Log in to reply