mirror of
https://github.com/SunBK201/UA3F.git
synced 2025-12-16 16:57:08 +00:00
feat: change default bind address
This commit is contained in:
parent
2cf4cdabd7
commit
223f5b72d3
@ -148,7 +148,7 @@ fw_setup_ipt_tproxy_tcp() {
|
||||
iptables -t mangle -A "$UA3F_CHAIN" -p tcp -m mark --mark "$UA3FMARK" -j RETURN
|
||||
iptables -t mangle -A "$UA3F_CHAIN" -m set --match-set "$IPSET_NAME" dst -j RETURN
|
||||
iptables -t mangle -A "$UA3F_CHAIN" -m conntrack --ctdir REPLY -j RETURN
|
||||
iptables -t mangle -A "$UA3F_CHAIN" -p tcp -j TPROXY --on-port "$SERVER_PORT" --tproxy-mark "$FWMARK"
|
||||
iptables -t mangle -A "$UA3F_CHAIN" -p tcp -j TPROXY --on-ip 127.0.0.1 --on-port "$SERVER_PORT" --tproxy-mark "$FWMARK"
|
||||
|
||||
# OUTPUT
|
||||
iptables -t mangle -F "$UA3F_OUT_CHAIN" 2>/dev/null
|
||||
|
||||
@ -4,7 +4,7 @@ config 'ua3f' 'enabled'
|
||||
config 'ua3f' 'main'
|
||||
option server_mode 'SOCKS5'
|
||||
option port '1080'
|
||||
option bind '127.0.0.1'
|
||||
option bind '0.0.0.0'
|
||||
option ua 'FFF'
|
||||
option ua_regex '(Apple|iPhone|iPad|Macintosh|Mac OS X|Mac|Darwin|Microsoft|Windows|Linux|Android|OpenHarmony|Mobile|Dalvik)'
|
||||
option partial_replace false
|
||||
|
||||
@ -55,5 +55,9 @@ func Parse() (*Config, bool) {
|
||||
UAPattern: uaPattern,
|
||||
EnablePartialReplace: partial,
|
||||
}
|
||||
if serverMode == ServerModeRedirect {
|
||||
cfg.BindAddr = "0.0.0.0"
|
||||
cfg.ListenAddr = fmt.Sprintf("0.0.0.0:%d", port)
|
||||
}
|
||||
return cfg, showVer
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user