We are currently developing a project which will get deployed as a WebGL application, and we'd like to communicate with the engine from another web application, preferably through web sockets. The engine exposes a WebSocket client interface through Lua which can connect to a web socket server and receive messages. However, we'd like to setup a bidirectional connection to the application directly, without having to go through a web socket server. Is this currently possible?
I found a video where such a setup was demonstrated: https://www.youtube.com/watch?v=tgrQ4kJbFWQ
but I haven't been able to get it to work. Is it possible to enable this feature somehow? Or did it never get included in engine?
The editor seems to talk to the engine through web sockets, which is described here: https://www.youtube.com/watch?v=Zxsu4O6_I7o&t=9s&index=4&list=PLUxuJBZBzEdxzVpoBQY9agA8JUgNkeYSV
However, I still haven't figured out how to make a connection to the engine from for example Chrome. I've tried establishing a connection with the following methods:
var ws = new WebSocket("ws://localhost") var ws = new WebSocket("ws://127.0.0.1") var ws = new WebSocket("ws://localhost/file_server") // see 2:44 in the aforementioned youtube video var ws = new WebSocket("ws://127.0.0.1/file_server")
var ws = new WebSocket("ws://localhost:8000/echo") // see 2:57 in the youtube video in my previous post
var ws = new WebSocket("ws://127.0.0.1:8000/echo")
var ws = new WebSocket("ws://localhost:8000")
All attempts has resulted in "Error in connection establishment: net::ERR_CONNECTION_REFUSED". Is the web socket server in the engine running on a different port?
My project was of course running in the background during my attempts.
Are you trying to connect to the engine while it is running in WebGL inside the browser? Because my understanding is that we can't open the websocket in listen mode while running in the browser.
If your engine is running on Windows, you can use the --port command-line argument to control what port the engine's console server listens to. But keep in mind that this built-in console server is only there in develop builds for the purpose of communicating with the editor. It's not present in release builds.
Can't find what you're looking for? Ask the community or share your knowledge.