Feature: add TCP TPROXY support (#1049)

This commit is contained in:
maskedeken
2020-11-09 10:46:10 +08:00
committed by GitHub
parent 87e4d94290
commit 83efe2ae57
11 changed files with 207 additions and 57 deletions

View File

@ -38,6 +38,7 @@ type Inbound struct {
Port int `json:"port"`
SocksPort int `json:"socks-port"`
RedirPort int `json:"redir-port"`
TProxyPort int `json:"tproxy-port"`
MixedPort int `json:"mixed-port"`
Authentication []string `json:"authentication"`
AllowLan bool `json:"allow-lan"`
@ -111,6 +112,7 @@ type RawConfig struct {
Port int `yaml:"port"`
SocksPort int `yaml:"socks-port"`
RedirPort int `yaml:"redir-port"`
TProxyPort int `yaml:"tproxy-port"`
MixedPort int `yaml:"mixed-port"`
Authentication []string `yaml:"authentication"`
AllowLan bool `yaml:"allow-lan"`
@ -234,6 +236,7 @@ func parseGeneral(cfg *RawConfig) (*General, error) {
Port: cfg.Port,
SocksPort: cfg.SocksPort,
RedirPort: cfg.RedirPort,
TProxyPort: cfg.TProxyPort,
MixedPort: cfg.MixedPort,
AllowLan: cfg.AllowLan,
BindAddress: cfg.BindAddress,