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

Adding proxy and CA SSL support #8

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

giubaru
Copy link
Contributor

@giubaru giubaru commented Sep 15, 2022

How to use the proxy support:

from request_boost import boosted_requests

number_of_sample_urls = 2
urls = [ f'https://postman-echo.com/get?random_data={test_no}' for test_no in range(number_of_sample_urls) ]
headers = [{'sample_header':test_no} for test_no in range(number_of_sample_urls)]

simple_results = boosted_requests(urls=urls, proxy={'http': 'localhost:8000'})

print(simple_results)

How to add SSL certification:

Here you should install: pip install certifi

import certifi
from request_boost import boosted_requests

number_of_sample_urls = 2
urls = [ f'https://postman-echo.com/get?random_data={test_no}' for test_no in range(number_of_sample_urls) ]
headers = [{'sample_header':test_no} for test_no in range(number_of_sample_urls)]

simple_results = boosted_requests(urls=urls, cafile=certifi.where())

print(simple_results)

@giubaru giubaru mentioned this pull request Sep 15, 2022
@singhsidhukuldeep
Copy link
Owner

singhsidhukuldeep commented Sep 18, 2022

@giubaru Thanks for the PR
I think a better way would be just to use *args and **kwargs

Otherwise, we would complicate things!

@Hex2424
Copy link

Hex2424 commented Feb 6, 2023

Agreed, I need this feature also for this project: https://github.com/Hex2424/ProxyRipper
I will fork your project and ask for merged changes. I see some commited changes towards proxy support by @giubaru , but it let you set only 1 proxy, it should work with list of proxies same as it done with list of urls.

req = urlrequest.Request(url)
req.set_proxy(proxy_host, 'http')

Also I think it should have additional argument and not kwargs, cuz granting confusion.

proxies = [
{'http': 'socks://localhost:8000', 
'https': 'socks://localhost:8000'}
]

 boosted_requests(urls=urls, proxies=proxies)

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

Successfully merging this pull request may close these issues.

None yet

3 participants