Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Concurrency issues when using websockets + proxies #4

Open
sleeyax opened this issue May 15, 2022 · 0 comments
Open

Concurrency issues when using websockets + proxies #4

sleeyax opened this issue May 15, 2022 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@sleeyax
Copy link
Owner

sleeyax commented May 15, 2022

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:

  • deadlock in a goroutine somewhere (although go's race detector can't find anything in particular)
  • the underlying connection getting abruptly closed due to some bug/issue in gorilla websockets, gotcha, fhttp, utls or even the Go language itself (yes, there's lots of possible points of failure!).
  • the remote server actually refusing the connection due to some detection mechanism

I've already wasted a ton of time working on this issue and unfortunately it's not worth my time anymore at this point. Up for grabs if anyone wants to work on this.

@sleeyax sleeyax added bug Something isn't working help wanted Extra attention is needed labels May 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant