[GH-ISSUE #4483] tls2raw plugin doesn't work, getting remotePort isn't defined during startup. #3543

Closed
opened 2026-05-05 14:16:38 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @JiachenRen on GitHub (Oct 12, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4483

Bug Description

In order to use the new tls2raw plugin, you would have to specify remotePort under proxies session, however during config validation it complains that remotePort isn't defined.

frpc Version

0.60.0

frps Version

0.60.0

System Architecture

linux/amd64

Configurations

frpc.toml

serverAddr = "..."
serverPort = "..."

auth.method = "token"
auth.token = "..."

transport.poolCount = 5

transport.tls.enable = true
transport.tls.certFile = "..."
transport.tls.keyFile = "..."
transport.tls.disableCustomTLSFirstByte = false

proxies
name = "ssh"
type = "tcp"
localIP = "127.0.0.1"
localPort = 22
remotePort = 6000

proxies
name = "..."
type = "https"
remotePort = 11001

[proxies.plugin]
type = "tls2raw"
localAddr = "127.0.0.1:11001"
crtPath = "..."
keyPath = "..."

proxies
name = "..."
type = "tcp"
localIP = "127.0.0.1"
localPort = 3478
remotePort = 3478

proxies
name = "..."
type = "udp"
localIP = "127.0.0.1"
localPort = 3478
remotePort = 3478

proxies
name = "nextcloud"
type = "https"
customDomains = ["..."]

[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:11000"
crtPath = "..."
keyPath = "..."
hostHeaderRewrite = "127.0.0.1"
requestHeaders.set.x-from-where = "frp"

Logs

frp ./frpc verify -c frpc.toml

unmarshal ProxyConfig error: json: unknown field "remotePort"

Steps to reproduce

  1. Write a https proxy with tls2raw plugin and custom remotePort (as specified in 2855ac71e3/conf/frpc_full_example.toml)
  2. frpc complains that remotePort isn't defined.

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @JiachenRen on GitHub (Oct 12, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4483 ### Bug Description In order to use the new tls2raw plugin, you would have to specify remotePort under [[proxies]] session, however during config validation it complains that remotePort isn't defined. ### frpc Version 0.60.0 ### frps Version 0.60.0 ### System Architecture linux/amd64 ### Configurations # frpc.toml serverAddr = "..." serverPort = "..." auth.method = "token" auth.token = "..." transport.poolCount = 5 transport.tls.enable = true transport.tls.certFile = "..." transport.tls.keyFile = "..." transport.tls.disableCustomTLSFirstByte = false [[proxies]] name = "ssh" type = "tcp" localIP = "127.0.0.1" localPort = 22 remotePort = 6000 [[proxies]] name = "..." type = "https" remotePort = 11001 [proxies.plugin] type = "tls2raw" localAddr = "127.0.0.1:11001" crtPath = "..." keyPath = "..." [[proxies]] name = "..." type = "tcp" localIP = "127.0.0.1" localPort = 3478 remotePort = 3478 [[proxies]] name = "..." type = "udp" localIP = "127.0.0.1" localPort = 3478 remotePort = 3478 [[proxies]] name = "nextcloud" type = "https" customDomains = ["..."] [proxies.plugin] type = "https2http" localAddr = "127.0.0.1:11000" crtPath = "..." keyPath = "..." hostHeaderRewrite = "127.0.0.1" requestHeaders.set.x-from-where = "frp" ### Logs frp ./frpc verify -c frpc.toml unmarshal ProxyConfig error: json: unknown field "remotePort" ### Steps to reproduce 1. Write a https proxy with tls2raw plugin and custom remotePort (as specified in https://github.com/fatedier/frp/blob/2855ac71e3fc3fb2859f4c75f97f97e99f131f1b/conf/frpc_full_example.toml) 2. frpc complains that remotePort isn't defined. ### Affected area - [ ] Docs - [ ] Installation - [X] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [X] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (Oct 14, 2024):

remotePort not for https proxy

<!-- gh-comment-id:2409886262 --> @fatedier commented on GitHub (Oct 14, 2024): remotePort not for https proxy
Author
Owner

@JiachenRen commented on GitHub (Oct 17, 2024):

Thanks for your prompt reply. In that case, I think it's misleading to add this in the example config under tls2raw plugin demo here. In this case, how would you configure a tls2raw connection from a custom remote port to a local port?

<!-- gh-comment-id:2418653777 --> @JiachenRen commented on GitHub (Oct 17, 2024): Thanks for your prompt reply. In that case, I think it's misleading to add this in the example config under tls2raw plugin demo [here](https://github.com/fatedier/frp/blob/b14192a8d3bb5b5a844977ea82de9a7d87dbdf06/conf/frpc_full_example.toml#L331). In this case, how would you configure a tls2raw connection from a custom remote port to a local port?
Author
Owner

@fatedier commented on GitHub (Oct 17, 2024):

That example is incorrect; I will submit a PR for the fix later.

TCP type proxies are configured with remotePort, while HTTPS type proxies reuse frps's vhostHTTPSPort and do not require remotePort configuration.

<!-- gh-comment-id:2418712194 --> @fatedier commented on GitHub (Oct 17, 2024): That example is incorrect; I will submit a PR for the fix later. TCP type proxies are configured with remotePort, while HTTPS type proxies reuse frps's vhostHTTPSPort and do not require remotePort configuration.
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#3543
No description provided.