[GH-ISSUE #4992] CloseWrite() implementation for socks5 plugin #3934

Closed
opened 2026-05-05 14:30:27 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @abhpal21 on GitHub (Sep 23, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/4992

Bug Description

Facing an issue where the remote client is not receiving FIN bit set by an application connected through socks proxy. The socks 5 plugin wraps the worker connection and sends it to go-socks5, handling the socks proxy 7cfa546b55/pkg/plugin/client/socks5.go (L55). go-socks5 on receiving FIN, calls the CloseWrite() on the worker connection, e75332964e/request.go (L360). There are two issues here,

  1. As the worker connection is wrapped, the CloseWrite() method is not found to be implemented and the write end of the connection is not closed.
  2. In our configuration, the worker connection is yamux stream. We would need to close the write end of the stream from the CloseWrite() method on the wrapper.

frpc Version

0.43.0

frps Version

0.43.0

System Architecture

linux/amd64

Configurations

ctl.clientCfg.TCPMux = true

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @abhpal21 on GitHub (Sep 23, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/4992 ### Bug Description Facing an issue where the remote client is not receiving FIN bit set by an application connected through socks proxy. The socks 5 plugin wraps the worker connection and sends it to go-socks5, handling the socks proxy https://github.com/fatedier/frp/blob/7cfa546b55ee485240c3a713b01a4923ee6b714c/pkg/plugin/client/socks5.go#L55. go-socks5 on receiving FIN, calls the CloseWrite() on the worker connection, https://github.com/armon/go-socks5/blob/e75332964ef517daa070d7c38a9466a0d687e0a5/request.go#L360. There are two issues here, 1. As the worker connection is wrapped, the CloseWrite() method is not found to be implemented and the write end of the connection is not closed. 2. In our configuration, the worker connection is yamux stream. We would need to close the write end of the stream from the CloseWrite() method on the wrapper. ### frpc Version 0.43.0 ### frps Version 0.43.0 ### System Architecture linux/amd64 ### Configurations ctl.clientCfg.TCPMux = true ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [x] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (Sep 23, 2025):

frp currently does not support TCP half-close natively; this is expected behavior.

<!-- gh-comment-id:3322407017 --> @fatedier commented on GitHub (Sep 23, 2025): frp currently does not support TCP half-close natively; this is expected behavior.
Author
Owner

@abhpal21 commented on GitHub (Sep 25, 2025):

Any plans to support in the near term or in pipeline? Can I contribute?

<!-- gh-comment-id:3333516975 --> @abhpal21 commented on GitHub (Sep 25, 2025): Any plans to support in the near term or in pipeline? Can I contribute?
Author
Owner

@fatedier commented on GitHub (Sep 25, 2025):

I don’t want to increase the project complexity for this.

<!-- gh-comment-id:3333544533 --> @fatedier commented on GitHub (Sep 25, 2025): I don’t want to increase the project complexity for this.
Author
Owner

@abhpal21 commented on GitHub (Sep 25, 2025):

Got it, Thanks. Will close the issue then.

<!-- gh-comment-id:3333588418 --> @abhpal21 commented on GitHub (Sep 25, 2025): Got it, Thanks. Will close the issue then.
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#3934
No description provided.