-
Hi, no matter what I try I keep getting errors when I enable any sort of proxy in the web capture settings.
While troubleshooting I opened up a socks5 connection from my server in the same poetry env as lookyloo: import aiohttp
from aiohttp_socks import ProxyType, ProxyConnector, ChainProxyConnector
async def fetch(url):
connector = ProxyConnector.from_url('socks5://user:pass@host:port')
async with aiohttp.ClientSession(connector=connector) as session:
async with session.get(url) as response:
return await response.text()
import asyncio
async def main():
text = await fetch('http://example.com')
print(text)
asyncio.run(main()) This works fine and prints out the text of example.com. Anything else I should try or change in my config? I'm not using global proxy, because it doesn't seem to support configuring the port at the moment. I'm also not using an external Lacus Instance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
I never tried HTTP proxies (simply because I have none at hand to check), but socks5 for tor is extensively tested and should work. Just to wrap up and make sure we're on the same page:
I have no way to test with the same settings as you, but I used this string as a proxy
"global_proxy": {
"enable": true,
"server": "socks5://127.0.0.1:9050",
"username": "",
"password": ""
} And capturing So I'm not completely sure what is going wrong. My suspicion is that it might be the username and password, and it might not be supported by the browser when passed like that ( Can you try to configure the global proxy this way? "global_proxy": {
"enable": true,
"server": "socks5://host:port",
"username": "user",
"password": "pass"
} |
Beta Was this translation helpful? Give feedback.
Update on that: microsoft/playwright#2425 (comment)
In short, socks5 authentication is not supported by playwright, sorry. But if your proxy can also do http(s), it should work.