lichess.org
Donate

Gorilla WebSocket -> engine server

Installing a desktop application on your computer is dangerous, don't do it. I'm also aware that this site is strongly in favor of in browser solutions as opposed to desktop solutions.

Having said this, still the fastest way to run a chess engine is running it as a native executable. Of course you cannot do this in a browser.

I hope you belive that Gorilla WebSocket that has 4385 stars and 785 forks on GitHub is not malware:

github.com/gorilla/websocket

Now, this module has an example callled 'command':

github.com/gorilla/websocket/tree/master/examples/command

It runs a system process and at the same time serves a web page on localhost in which you can type in a command that goes to the standard input of this process and get the response coming from this process printed in the browser window.

The engine is just a process, so you can manually run a native chess engine in the browser already using this simple example.

The only thing is that you have to type in commands and get the raw analysis output which is not very readable.

If you add some graphical interface and thinking output processing to this program, it can become an engine server which lets you analyze chess positions in your browser at native speed without the need to compile the engine into some format that the browser can run ( with performance loss ).

Just an idea.
This engine server would be a great addition to Lichess.
Can you contact the Lichess team to work together to implement this as a native add to Lichess as an option (for users that prefer this full speed engine server) ?
Suggesting the idea here does count as contacting the team. :-)

I thought about 2 months ago some enthusiast said they were doing something similar? I recommended they integrate with Lichess studies, which would require no code change from Lichess.
Currently I'm experimenting with a Node.js engine server.

I found this websocket implementation in Node ( 6678 stars on GithHub, passes the Autobahn test suite ):

github.com/websockets/ws

This is extremely stable, while in the other implementations the socket fails from time to time, I could not make this socket fail once yet.

So the three implementations I have tried so far rank as follows:

Node.js server ( with ws ) --- extreme stable, quick startup, needs Node.js runtime

Play 2.6 server --- fairly stable, disturbingly slow startup, needs Java runtime

Golang server ( with Gorilla websocket ) --- experimental, very quick startup, produces native executable

This topic has been archived and can no longer be replied to.