[PR #2601] [CLOSED] feat: wss support (#2194) #4598

Closed
opened 2026-05-05 14:45:06 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fatedier/frp/pull/2601
Author: @tudyzhb
Created: 10/4/2021
Status: Closed

Base: devHead: wss


📝 Commits (1)

📊 Changes

2 files changed (+14 additions, -2 deletions)

View changed files

📝 client/service.go (+13 -0)
📝 pkg/util/net/websocket.go (+1 -2)

📄 Description

Among the supported protocol in FRP, WebSocket is more special(located at layer 7 in the OSI model) than TCP and KCP.

We should support URL format configuration to connect to server instead of hard-code domain:port format.

And then obtain the WSS support feature gracefully.

  • BEFORE use domain:port to connect server

frpc.ini:

[common]
server_addr = frps.server.host
server_port = 7007
token = SECRET
tls_enable = true
protocol = websocket
  • AFTER extra support URL to connect server

frpc.ini:

[common]
server_addr = wss://frps.server.host/frps/
token = SECRET
tls_enable = true
protocol = websocket

nginx.conf:

... 
# frps websocket proxy
location /frps/ {
    proxy_redirect off;
    proxy_pass http://127.0.0.1:7007/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $http_host;
    proxy_read_timeout 600s;
}
...

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fatedier/frp/pull/2601 **Author:** [@tudyzhb](https://github.com/tudyzhb) **Created:** 10/4/2021 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `wss` --- ### 📝 Commits (1) - [`91c9011`](https://github.com/fatedier/frp/commit/91c90117366a54331eb61553ddce450ab7d89431) feat: wss support (#2194) ### 📊 Changes **2 files changed** (+14 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `client/service.go` (+13 -0) 📝 `pkg/util/net/websocket.go` (+1 -2) </details> ### 📄 Description Among the supported protocol in FRP, **WebSocket** is more special(located at layer 7 in the OSI model) than TCP and KCP. We should support `URL format` configuration to connect to server instead of hard-code `domain:port format`. And then obtain the **WSS support** feature gracefully. - BEFORE use `domain:port` to connect server `frpc.ini`: ```frpc.ini [common] server_addr = frps.server.host server_port = 7007 token = SECRET tls_enable = true protocol = websocket ``` - AFTER extra support `URL` to connect server `frpc.ini`: ```frpc.ini [common] server_addr = wss://frps.server.host/frps/ token = SECRET tls_enable = true protocol = websocket ``` `nginx.conf`: ```nginx.conf ... # frps websocket proxy location /frps/ { proxy_redirect off; proxy_pass http://127.0.0.1:7007/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $http_host; proxy_read_timeout 600s; } ... ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 14:45:06 -06:00
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: github-starred/frp#4598
No description provided.