Fixed not specifying headers for TCP HTTP protocol

This commit is contained in:
lilendian0x00
2023-11-08 03:36:44 -08:00
parent 2274520633
commit 611ef875c4
+23
View File
@@ -535,6 +535,29 @@ class ProxyOutboundObject(OutboundObject):
'type': headerType,
}
# Request settings for HTTP
if self.kwargs.get('host'):
TcpObject['header']['request'] = {}
requestObject = TcpObject['header']['request']
requestObject['version'] = "1.1"
requestObject['method'] = "GET"
requestObject['path'] = [self.kwargs.get('path', '/')]
requestObject['headers'] = {
'Host': [unquote(self.kwargs.get('host'))],
'User-Agent': [
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36"
],
"Accept-Encoding": [
"gzip, deflate"
],
"Connection": [
"keep-alive"
],
"Pragma": "no-cache"
}
return TcpObject
elif self.type_ == 'kcp':