Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

It works from command line but not from within a python script #112

Closed
analyserdmz opened this issue Feb 22, 2021 · 2 comments
Closed

It works from command line but not from within a python script #112

analyserdmz opened this issue Feb 22, 2021 · 2 comments

Comments

@analyserdmz
Copy link

Hello, thanks for pproxy, it's very useful. One problem I am facing is that the following command works well (I can browse the internet normally)...

C:\tools>pproxy -l http://127.0.0.1:12345 -r socks5://127.0.0.1:9050
Serving on 127.0.0.1:12345 by http

...but the following script, with the same schemes and settings, doesn't work (I get the error at the end of this issue):

import asyncio
import pproxy

server = pproxy.Server('http://127.0.0.1:12345')
remote = pproxy.Connection('socks5://127.0.0.1:9050')
args = dict( rserver = [remote],
             verbose = print )

loop = asyncio.get_event_loop()
handler = loop.run_until_complete(server.start_server(args))
try:
    loop.run_forever()
except KeyboardInterrupt:
    print('exit!')

handler.close()
loop.run_until_complete(handler.wait_closed())
loop.run_until_complete(loop.shutdown_asyncgens())
loop.close()

The error I got:
http_accept() missing 1 required positional argument: 'httpget' from 127.0.0.1

@qwj
Copy link
Owner

qwj commented Feb 23, 2021

It is a bug that occurs with http server api. Please upgrade to v2.7.4 to get it fixed. Thanks

@analyserdmz
Copy link
Author

@qwj it's working as expected now! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants