Skip to content

Commit

Permalink
add cookies support
Browse files Browse the repository at this point in the history
  • Loading branch information
gorgiaxx committed Mar 8, 2017
1 parent 305d31d commit 21cc084
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Advanced Options
`--start-ping, -s` Start the pinging thread first - some services send
data first (eg. SSH)

`--cookie, -C` Request cookies

* See limitations

Expand Down
3 changes: 2 additions & 1 deletion lib/TunnaClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def __init__(self, url , options):
remote_ip = options['remote_ip']
remote_port = options['remote_port']
verbose = options['verbose']
self.cookie = options['cookie']

self.url=url

Expand Down Expand Up @@ -248,7 +249,7 @@ def HTTPreq(self,url,data=None,headers=None):
kargs['url']=url
if data: kargs['data']=data #Will do a GET if no data else POST
if headers: kargs['headers']=headers
else: kargs['headers']={'Content-Type':'application/octet-stream'}
else: kargs['headers']={'Content-Type':'application/octet-stream','Cookie':self.cookie}

#Make Request
f=opener.open(urllib2.Request(**kargs))
Expand Down
Empty file removed lib/__init__.py
Empty file.
1 change: 1 addition & 0 deletions proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def main():
advancedGroup.add_option('-q','--ping-interval', help='webshprx pinging thread interval (default = 0.5)', dest='ping_delay', action='store', type='float', default=Defaults['ping_delay'])
advancedGroup.add_option('-s','--start-ping', help='Start the pinging thread first - some services send data first (eg. SSH)', dest='start_p_thread', action='store_true', default=Defaults['start_p_thread'])
advancedGroup.add_option('-c','--verify-server-cert', help='Verify Server Certificate', dest='start_p_thread', action='store_false', default=Defaults['ignoreServerCert'])
advancedGroup.add_option('-C','--cookie', help='Request cookies', dest='cookie', action='store', default=Defaults['Cookie'])

parser.add_option_group(advancedGroup)

Expand Down
5 changes: 4 additions & 1 deletion settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@

#! Not to be changed
'ProxyFileWin':'lib/socks4aServer.exe',
'ProxyFilePy':'lib/socks4aServer.py'
'ProxyFilePy':'lib/socks4aServer.py',

#! HTTP headers
'Cookie':'',
}

Webserver_Defaults ={
Expand Down

0 comments on commit 21cc084

Please sign in to comment.