sleeyax / aternos-api

Unofficial aternos.org API/library to start & stop servers programmatically
GNU General Public License v3.0
19 stars 6 forks source link

Concurrency issues when using websockets + proxies #4

Open sleeyax opened 2 years ago

sleeyax commented 2 years ago

For some reason connections start to fail when using a (rotating) proxy over websockets. Mostly weird EOF errors.

There's some progress being made on this issue in this branch, including a mechanism to reconnect on failure, though it's far from perfect:

2022/05/15 17:44:37 main 1: server is starting
2022/05/15 17:44:39 main 0: server is starting
2022/05/15 17:44:41 main 2: server is starting
2022/05/15 17:44:42 reader: server closed the connection unexpectedly [websocket: close 1006 (abnormal closure): unexpected EOF], reconnecting...
2022/05/15 17:44:44 reader: server closed the connection unexpectedly [websocket: close 1006 (abnormal closure): unexpected EOF], reconnecting...
2022/05/15 17:44:46 reader: server closed the connection unexpectedly [websocket: close 1006 (abnormal closure): unexpected EOF], reconnecting...
2022/05/15 17:44:49 reader: server closed the connection unexpectedly [websocket: close 1006 (abnormal closure): unexpected EOF], reconnecting...
2022/05/15 17:44:51 reader: server closed the connection unexpectedly [websocket: close 1006 (abnormal closure): unexpected EOF], reconnecting...
2022/05/15 17:44:53 reader: server closed the connection unexpectedly [websocket: close 1006 (abnormal closure): unexpected EOF], reconnecting...

The issue is likely any of the following: