Xray-core icon indicating copy to clipboard operation
Xray-core copied to clipboard

inbounds / redirect "listen": "0.0.0.0" 會監聽ipv6

Open xgmq opened this issue 2 years ago • 2 comments

下面設定 "listen": "0.0.0.0", 會監聽ipv6。查過好像是go lang 的bug。 希望改成只監聽ipv4。

謝謝

"inbounds": [
	{
		"tag": "transparent",
		"listen": "0.0.0.0",
		"port": 1234,
		"protocol": "dokodemo-door",
		"settings": {
			"network": "tcp",
			"followRedirect": true
		},
		"sniffing": {
			"enabled": true,
			"destOverride": ["fakedns"],
			"metadataOnly": true
		},
		"streamSettings": {
			"sockopt": {
				"tproxy": "redirect"
			}
		}
	},

xgmq avatar Dec 14 '23 17:12 xgmq

https://xtls.github.io/config/inbound.html#inboundobject

listen: address

监听地址,IP 地址或 Unix domain socket,默认值为 "0.0.0.0",表示接收所有网卡上的连接.

chise0713 avatar Dec 14 '23 20:12 chise0713

https://xtls.github.io/config/inbound.html#inboundobject

listen: address

监听地址,IP 地址或 Unix domain socket,默认值为 "0.0.0.0",表示接收所有网卡上的连接.

剛剛測了好像全都會監聽ipv6。跟預期的不太一樣。

hysteria有為這個做修改。

https://github.com/apernet/hysteria/pull/842

https://github.com/apernet/hysteria/commit/21cd348c8b40afcdb49ef51add4479d1d75335f2

如果可以改的話不錯。不改的話也是可以用。 就分開監聽 127.0.0.1、192.168.x.x。然後設定檔移植到其他地方的時候要針對當時的IP改一下。

很多家用防火牆沒有在擋ipv6,如果有開socks的話建議檢查一下家裡的socks服務有沒有暴露在外網下。

xgmq avatar Dec 14 '23 20:12 xgmq

Fixed

Fangliding avatar Apr 11 '24 16:04 Fangliding