HTTP出站代理是否可以指定Headers? #2172
-
前情是这样的,我也参考了之前有个QA尝试了REALITY Over Socks5,这也让我有了更多点子,在公共网络中配合多种协议,甚至明文在公网中传输HTTP/Socks 问题假如我想在明文中传输HTTP协议(测试配置如下) {
"routing": {
"domainStrategy": "AsIs",
"rules": [
{
"inboundTag": [
"in-http"
],
"outboundTag": "out-http-loopback",
"type": "field"
}
]
},
"inbounds": [
{
"protocol": "http",
"tag": "in-http",
"port": 61404,
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
},
{
"protocol": "http",
"tag": "in-http-1",
"port": 61405,
"settings": {
"accounts": [
{
"user": "FAKEVALUE",
"pass": "FAKEVALUE"
}
]
},
"sniffing": {
"enabled": true,
"destOverride": [
"http",
"tls"
]
}
}
],
"outbounds": [
{
"protocol": "freedom"
},
{
"protocol": "http",
"tag": "out-http-loopback",
"settings": {
"servers": [
{
"address": "127.0.0.1",
"port": 61405,
"users": [
{
"user": "FAKEVALUE",
"pass": "FAKEVALUE"
}
]
}
]
}
}
]
}
我抓包分析后,发现有一个Header过于显眼
另外底层传输协议( 补充说明我现在不考虑明文传输HTTP的可用性和安全性,只考虑能否实现,以后说不定有更好的点子,不要揪着这一点 |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
這個簡單呀,改代碼,從新編譯
或者等貢獻者增加自定義UA功能@RPRX |
Beta Was this translation helpful? Give feedback.
-
Can this be used to pass a session/user identifier upstream? I could use it to guarantee sticky exit points without having to create a separate outbound for each individual user. |
Beta Was this translation helpful? Give feedback.
-
@flowerinsnowdh @nursery01 @chika0801
我在抓包的时候为什么就没有这个X-Real-IP呢 |
Beta Was this translation helpful? Give feedback.
不用了,谢谢,我翻了翻源码,发现XRAY自带这个功能,只是文档里没有写
config.pb.go
配置改成这样
不会报错,而且工作也正常