yowsup icon indicating copy to clipboard operation
yowsup copied to clipboard

Configure http proxy for yowsup-cli

Open vivek1729 opened this issue 12 years ago • 11 comments

I am behind a proxy server in college and can't get yowsup-cli to work because apparently the httplib used by the python scripts need to be configured for proxy before they can send and receive http requests.

I tried editing some lines in the sendrequest method of warequest.py :

 conn = httplib.HTTPSConnection('localhost',8118) #My proxy host and port        
 conn.request(reqType, host+path, params, headers);

This however did not work. The login mechanism also must be making some http requests and I'm sure it's possible to configure my proxy host and port for yowsup-cli to work properly. Is there some global setting for proxy in yowsup-cli? If not how do I go about this issue? Any help is deeply appreciated.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

vivek1729 avatar Feb 05 '14 07:02 vivek1729

Any solution?

Marcorele avatar May 29 '14 16:05 Marcorele

there is separate connections for registration and protocol only. no different connections for login in protocol, as login is a part of protocol :)

CODeRUS avatar May 29 '14 16:05 CODeRUS

Ok, thank you.

So why the vivek1729 solution don't work?

Marcorele avatar May 29 '14 16:05 Marcorele

because he set proxy for registration only, not for protocol socket.

CODeRUS avatar May 29 '14 16:05 CODeRUS

Ok, now i understand.

Can you say me where i can found protocol socket code? Thank you

Marcorele avatar May 29 '14 16:05 Marcorele

no idea how to add proxy for socket in python, but this is the main socket class in yowsup: https://github.com/tgalal/yowsup/blob/master/src/Yowsup/ConnectionIO/connectionengine.py

CODeRUS avatar May 29 '14 16:05 CODeRUS

And this one is connecting socket to host: https://github.com/tgalal/yowsup/blob/master/src/Yowsup/Auth/auth.py#L62

CODeRUS avatar May 29 '14 16:05 CODeRUS

Ok i will try to do it and post here the result. Thx

Marcorele avatar May 29 '14 16:05 Marcorele

@Marcorele, any solution?

eliasjnior avatar Jun 04 '14 16:06 eliasjnior

I added support a http proxy. Check my pull request #742.

dinhoabreu avatar Apr 30 '15 22:04 dinhoabreu

@dinhoabreu patch worked :+1:

biji avatar Nov 03 '15 10:11 biji