-
Notifications
You must be signed in to change notification settings - Fork 25
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
My project based on PyWorkflow #14
Comments
To use http proxy, you may create an http task with proxy's URL like this: http://proxy-host-name:port/ ,set the request URI: task.get_req().set_request_uri("http://www.sogou.com/"), and then set the "Host" header: task.get_req().set_header_pair("Host", "www.sogou.com") |
Thanks, let me have a try |
It works. Expect solution for https proxy. |
GOOD NEWSpyworkflow support visit http(s) server with http proxy now ( #19 ) you can use it as simple as normal http tasks import pywf as wf
def http_callback(t):
if t.get_state() != wf.WFT_STATE_SUCCESS:
print(wf.get_error_string(t.get_state(), t.get_error()))
return
resp = t.get_resp()
print("{} {} {}".format(
resp.get_http_version(), resp.get_status_code(), resp.get_reason_phrase()
))
task = wf.create_http_task(
url = "https://www.sogou.com/",
proxy_url = "http://user:[email protected]:port", # Your http proxy here
redirect_max = 2,
retry_max = 2,
callback = http_callback)
task.start()
wf.wait_finish() |
@kedixa Good job, it's GREAT. |
Hi guys, I have created a project os-pywf which wrap the PyWorkfow provide high level APIs and command line tools.
I have released Requets like APIs and provide a command line tool same as curl but more flexible work with Python scripts.
My project can be installed with pip
During developing, I find some features depond on PyWorkflow, need your help
The text was updated successfully, but these errors were encountered: