Webscoket(TCP 21116, is it Relay?) connection is broke behind reverse proxy #3059

Closed
opened 2026-02-21 01:05:16 -05:00 by deekerman · 1 comment
Owner

Originally created by @JobberRT on GitHub (Oct 19, 2024).

Bug Description

First of all, I've submit a issue in the reverse proxy's repo : https://github.com/fatedier/frp/issues/4501 And I've test that the reverse proxy works(because other webscoket server works behind the reverse proxy, only hbbr and hbbs).

Behavior

  1. I can connect to the client only if my computer/client/reverse proxy are in the same network no matter whether the direct-peering is enabled(disable the direct-peering seems taking no effect, wireshark shows it still connecting through private network ip rather than reverse proxy's server ip).
  2. Before I test disabling direct-peering, I can connect to the client if the client and the reverse proxy are in the same network, and my computer doesn't have to be. But after I tested it, no matter whether I disable the direct-peering, I'm stuck at the behavior of step1(both my computer/client/reverse proxy must inside the same network).

HBBS log

[2024-10-19 07:38:33.056831 +00:00] DEBUG [src/rendezvous_server.rs:1153] Tcp connection from [::ffff:172.18.0.2]:52164 closed

[2024-10-19 07:38:48.057944 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:37800, ws: true

[2024-10-19 07:38:48.057964 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:36150, ws: false

[2024-10-19 07:38:48.058142 +00:00] DEBUG [src/rendezvous_server.rs:1101] WebSocket protocol error: Handshake not finished

Caused by:

    Handshake not finished, hbbs::rendezvous_server:src/rendezvous_server.rs:1101:13

[2024-10-19 07:38:48.058160 +00:00] DEBUG [src/rendezvous_server.rs:1153] Tcp connection from [::ffff:172.18.0.2]:36150 closed

[2024-10-19 07:39:03.059313 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:37140, ws: true

[2024-10-19 07:39:03.059343 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:51934, ws: false

[2024-10-19 07:39:03.059408 +00:00] DEBUG [src/rendezvous_server.rs:1101] WebSocket protocol error: Handshake not finished

Caused by:

    Handshake not finished, hbbs::rendezvous_server:src/rendezvous_server.rs:1101:13

[2024-10-19 07:39:03.059421 +00:00] DEBUG [src/rendezvous_server.rs:1153] Tcp connection from [::ffff:172.18.0.2]:51934 closed

[2024-10-19 07:39:18.060588 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:35940, ws: true

[2024-10-19 07:39:18.060610 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:49548, ws: false

[2024-10-19 07:39:18.060706 +00:00] DEBUG [src/rendezvous_server.rs:1101] WebSocket protocol error: Handshake not finished

HBBR log

[2024-10-19 07:37:48.052967 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished

Caused by:

    Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9

[2024-10-19 07:38:03.053927 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished

Caused by:

    Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9

[2024-10-19 07:38:18.055358 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished

Caused by:

    Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9

[2024-10-19 07:38:33.056840 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished

Caused by:

    Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9

[2024-10-19 07:38:48.058147 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished

Caused by:

    Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9

How to Reproduce

  1. Deploy the reverse proxy(frp) and the rustdesk server
  2. Test the connection inside the same network (will success)
  3. Test the connection in different network(will failed, controlling side is in a different network than controlled side and reverse proxy)

Expected Behavior

I can connect to the controlled client using the reverse proxy (Of course I mean controlling client is in a different network than the controlled client)

Operating system(s) on local side and remote side

Ubuntu 24.04 with Docker Engine V27.0.3

RustDesk Version(s) on local side and remote side

1.1.12(Server) -> 1.3.1(Client)

Screenshots

Rustdesk connection timeout(Stuck at connecting for a long time and then turns into an error: Timeout)

image

Wireshark packages if controlling client is in the same network as the controlled client(no matter direct-peering is enabled, keep using the private ip and Success)

image

Wireshark packages if controlling client is not in the same network as the controlled client(Failed)

image

Additional Context

No response

Originally created by @JobberRT on GitHub (Oct 19, 2024). ### Bug Description First of all, I've submit a issue in the reverse proxy's repo : https://github.com/fatedier/frp/issues/4501 And I've test that the reverse proxy works(because other webscoket server works behind the reverse proxy, only `hbbr` and `hbbs`). ### Behavior 1. I can connect to the client only if my computer/client/reverse proxy are in the same network no matter whether the direct-peering is enabled(disable the direct-peering seems taking no effect, wireshark shows it still connecting through private network ip rather than reverse proxy's server ip). 2. Before I test disabling direct-peering, I can connect to the client if the client and the reverse proxy are in the same network, and my computer doesn't have to be. But after I tested it, no matter whether I disable the direct-peering, I'm stuck at the behavior of step1(both my computer/client/reverse proxy must inside the same network). ### HBBS log ```shell [2024-10-19 07:38:33.056831 +00:00] DEBUG [src/rendezvous_server.rs:1153] Tcp connection from [::ffff:172.18.0.2]:52164 closed [2024-10-19 07:38:48.057944 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:37800, ws: true [2024-10-19 07:38:48.057964 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:36150, ws: false [2024-10-19 07:38:48.058142 +00:00] DEBUG [src/rendezvous_server.rs:1101] WebSocket protocol error: Handshake not finished Caused by: Handshake not finished, hbbs::rendezvous_server:src/rendezvous_server.rs:1101:13 [2024-10-19 07:38:48.058160 +00:00] DEBUG [src/rendezvous_server.rs:1153] Tcp connection from [::ffff:172.18.0.2]:36150 closed [2024-10-19 07:39:03.059313 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:37140, ws: true [2024-10-19 07:39:03.059343 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:51934, ws: false [2024-10-19 07:39:03.059408 +00:00] DEBUG [src/rendezvous_server.rs:1101] WebSocket protocol error: Handshake not finished Caused by: Handshake not finished, hbbs::rendezvous_server:src/rendezvous_server.rs:1101:13 [2024-10-19 07:39:03.059421 +00:00] DEBUG [src/rendezvous_server.rs:1153] Tcp connection from [::ffff:172.18.0.2]:51934 closed [2024-10-19 07:39:18.060588 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:35940, ws: true [2024-10-19 07:39:18.060610 +00:00] DEBUG [src/rendezvous_server.rs:1097] Tcp connection from [::ffff:172.18.0.2]:49548, ws: false [2024-10-19 07:39:18.060706 +00:00] DEBUG [src/rendezvous_server.rs:1101] WebSocket protocol error: Handshake not finished ``` ### HBBR log ```shell [2024-10-19 07:37:48.052967 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished Caused by: Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9 [2024-10-19 07:38:03.053927 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished Caused by: Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9 [2024-10-19 07:38:18.055358 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished Caused by: Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9 [2024-10-19 07:38:33.056840 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished Caused by: Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9 [2024-10-19 07:38:48.058147 +00:00] DEBUG [src/relay_server.rs:389] WebSocket protocol error: Handshake not finished Caused by: Handshake not finished, hbbr::relay_server:src/relay_server.rs:389:9 ``` ### How to Reproduce 1. Deploy the reverse proxy([frp](https://github.com/fatedier/frp)) and the rustdesk server 2. Test the connection inside the same network (will success) 3. Test the connection in different network(will failed, controlling side is in a different network than controlled side and reverse proxy) ### Expected Behavior I can connect to the controlled client using the reverse proxy (Of course I mean controlling client is in a different network than the controlled client) ### Operating system(s) on local side and remote side Ubuntu 24.04 with Docker Engine V27.0.3 ### RustDesk Version(s) on local side and remote side 1.1.12(Server) -> 1.3.1(Client) ### Screenshots ## Rustdesk connection timeout(Stuck at connecting for a long time and then turns into an error: Timeout) <img width="864" alt="image" src="https://github.com/user-attachments/assets/1317422d-f574-4daa-94ac-5182bcdd36ee"> ## Wireshark packages if controlling client is in the same network as the controlled client(no matter direct-peering is enabled, keep using the private ip and Success) <img width="1705" alt="image" src="https://github.com/user-attachments/assets/32ae0b56-13d5-4440-a1b0-da46c5d2aef4"> ## Wireshark packages if controlling client is not in the same network as the controlled client(Failed) <img width="1651" alt="image" src="https://github.com/user-attachments/assets/48822152-4493-49cc-82be-0e1a21bdcafb"> ### Additional Context _No response_
deekerman 2026-02-21 01:05:16 -05:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@rustdesk commented on GitHub (Oct 19, 2024):

#763

@rustdesk commented on GitHub (Oct 19, 2024): #763
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/rustdesk-rustdesk#3059
No description provided.