mirror of
https://github.com/shtorm-7/sing-box-extended.git
synced 2026-09-15 21:00:27 +00:00
Add listen_port option to Tailscale endpoint
This commit is contained in:
@@ -4,6 +4,7 @@ icon: material/new-box
|
|||||||
|
|
||||||
!!! quote "Changes in sing-box 1.14.0"
|
!!! quote "Changes in sing-box 1.14.0"
|
||||||
|
|
||||||
|
:material-plus: [listen_port](#listen_port)
|
||||||
:material-plus: [ssh_server](#ssh_server)
|
:material-plus: [ssh_server](#ssh_server)
|
||||||
|
|
||||||
!!! quote "Changes in sing-box 1.13.0"
|
!!! quote "Changes in sing-box 1.13.0"
|
||||||
@@ -34,6 +35,7 @@ icon: material/new-box
|
|||||||
"advertise_routes": [],
|
"advertise_routes": [],
|
||||||
"advertise_exit_node": false,
|
"advertise_exit_node": false,
|
||||||
"advertise_tags": [],
|
"advertise_tags": [],
|
||||||
|
"listen_port": 0,
|
||||||
"relay_server_port": 0,
|
"relay_server_port": 0,
|
||||||
"relay_server_static_endpoints": [],
|
"relay_server_static_endpoints": [],
|
||||||
"system_interface": false,
|
"system_interface": false,
|
||||||
@@ -121,6 +123,14 @@ Tags to advertise for this node, for ACL enforcement purposes.
|
|||||||
|
|
||||||
Example: `["tag:server"]`
|
Example: `["tag:server"]`
|
||||||
|
|
||||||
|
#### listen_port
|
||||||
|
|
||||||
|
!!! question "Since sing-box 1.14.0"
|
||||||
|
|
||||||
|
The UDP port to listen on for WireGuard and peer-to-peer traffic.
|
||||||
|
|
||||||
|
A port is automatically selected by default.
|
||||||
|
|
||||||
#### relay_server_port
|
#### relay_server_port
|
||||||
|
|
||||||
!!! question "Since sing-box 1.13.0"
|
!!! question "Since sing-box 1.13.0"
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ icon: material/new-box
|
|||||||
|
|
||||||
!!! quote "sing-box 1.14.0 中的更改"
|
!!! quote "sing-box 1.14.0 中的更改"
|
||||||
|
|
||||||
|
:material-plus: [listen_port](#listen_port)
|
||||||
:material-plus: [ssh_server](#ssh_server)
|
:material-plus: [ssh_server](#ssh_server)
|
||||||
|
|
||||||
!!! quote "sing-box 1.13.0 中的更改"
|
!!! quote "sing-box 1.13.0 中的更改"
|
||||||
@@ -34,6 +35,7 @@ icon: material/new-box
|
|||||||
"advertise_routes": [],
|
"advertise_routes": [],
|
||||||
"advertise_exit_node": false,
|
"advertise_exit_node": false,
|
||||||
"advertise_tags": [],
|
"advertise_tags": [],
|
||||||
|
"listen_port": 0,
|
||||||
"relay_server_port": 0,
|
"relay_server_port": 0,
|
||||||
"relay_server_static_endpoints": [],
|
"relay_server_static_endpoints": [],
|
||||||
"system_interface": false,
|
"system_interface": false,
|
||||||
@@ -120,6 +122,14 @@ icon: material/new-box
|
|||||||
|
|
||||||
示例:`["tag:server"]`
|
示例:`["tag:server"]`
|
||||||
|
|
||||||
|
#### listen_port
|
||||||
|
|
||||||
|
!!! question "自 sing-box 1.14.0 起"
|
||||||
|
|
||||||
|
监听 WireGuard 和点对点流量的 UDP 端口。
|
||||||
|
|
||||||
|
默认自动选择端口。
|
||||||
|
|
||||||
#### relay_server_port
|
#### relay_server_port
|
||||||
|
|
||||||
!!! question "自 sing-box 1.13.0 起"
|
!!! question "自 sing-box 1.13.0 起"
|
||||||
|
|||||||
@@ -4534,6 +4534,11 @@
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"listen_port": {
|
||||||
|
"type": "integer",
|
||||||
|
"minimum": 0,
|
||||||
|
"maximum": 65535
|
||||||
|
},
|
||||||
"relay_server_port": {
|
"relay_server_port": {
|
||||||
"type": "integer",
|
"type": "integer",
|
||||||
"minimum": 0,
|
"minimum": 0,
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ type TailscaleEndpointOptions struct {
|
|||||||
AdvertiseRoutes []netip.Prefix `json:"advertise_routes,omitempty"`
|
AdvertiseRoutes []netip.Prefix `json:"advertise_routes,omitempty"`
|
||||||
AdvertiseExitNode bool `json:"advertise_exit_node,omitempty"`
|
AdvertiseExitNode bool `json:"advertise_exit_node,omitempty"`
|
||||||
AdvertiseTags badoption.Listable[string] `json:"advertise_tags,omitempty"`
|
AdvertiseTags badoption.Listable[string] `json:"advertise_tags,omitempty"`
|
||||||
|
ListenPort uint16 `json:"listen_port,omitempty"`
|
||||||
RelayServerPort *uint16 `json:"relay_server_port,omitempty"`
|
RelayServerPort *uint16 `json:"relay_server_port,omitempty"`
|
||||||
RelayServerStaticEndpoints []netip.AddrPort `json:"relay_server_static_endpoints,omitempty"`
|
RelayServerStaticEndpoints []netip.AddrPort `json:"relay_server_static_endpoints,omitempty"`
|
||||||
SystemInterface bool `json:"system_interface,omitempty"`
|
SystemInterface bool `json:"system_interface,omitempty"`
|
||||||
|
|||||||
@@ -202,6 +202,7 @@ func NewEndpoint(ctx context.Context, router adapter.Router, logger log.ContextL
|
|||||||
Ephemeral: options.Ephemeral,
|
Ephemeral: options.Ephemeral,
|
||||||
AuthKey: options.AuthKey,
|
AuthKey: options.AuthKey,
|
||||||
ControlURL: options.ControlURL,
|
ControlURL: options.ControlURL,
|
||||||
|
Port: options.ListenPort,
|
||||||
AdvertiseTags: options.AdvertiseTags,
|
AdvertiseTags: options.AdvertiseTags,
|
||||||
Dialer: &endpointDialer{Dialer: outboundDialer, logger: logger},
|
Dialer: &endpointDialer{Dialer: outboundDialer, logger: logger},
|
||||||
LookupHook: func(ctx context.Context, host string) ([]netip.Addr, error) {
|
LookupHook: func(ctx context.Context, host string) ([]netip.Addr, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user