Repository: fatedier/frp (language: go)

Issue:
tls2raw plugin doesn't work, getting remotePort isn't defined during startup.
### 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


Discussion / hints:
remotePort not for https proxy
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?
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.

Fix patch:
diff --git a/conf/frpc_full_example.toml b/conf/frpc_full_example.toml
index 3bf868663b3..eb44739239d 100644
--- a/conf/frpc_full_example.toml
+++ b/conf/frpc_full_example.toml
@@ -327,7 +327,7 @@ requestHeaders.set.x-from-where = "frp"
 
 [[proxies]]
 name = "plugin_tls2raw"
-type = "https"
+type = "tcp"
 remotePort = 6008
 [proxies.plugin]
 type = "tls2raw"


Test patch: