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
connector.py file doesn't correctly set CONNECT method #4429
Comments
You use a third-party proxy lib so you should probably ask them how to use it. Also, this place is for bug reports. It's best to ask for help via Gitter/StackOverflow/Mailing lists. |
Ah ok, my bad .. I will ask there. Thanks for your reply :) |
Btw, I didn't mean to use the 3rd party stuff, I want to just use the original files, seems I can't connect to it? Per th docs: I'm still trying to get a connection but I'm getting yelled at:
|
OK, I've been going in circles and I do think there is a bug now. From the very beginning I have been doing the correct way of connecting proxies to aiohttp. It is NOT the way to do the ProxyConnector anymore, I just have to add the proxy in to the session.get parameters like
I have been doing this from the very start but I was getting this error: OK, this had me thinking I needed to do some extra steps so I looked and looked ... but in the wrong places and went off on tangents exploring 3rd party stuff etc. I looked into aiohttps's files and I see there actually IS a CONNECT method in there to make the switch from http to https in the connector.py file .. but I think it's broken? Because it's not working, I cannot connect to sites that are https, but have no problem connecting to http site. I think this is an issue? |
You linked a 5-year-old version docs. Have you checked docs of the current stable aiohttp version? https://docs.aiohttp.org/en/stable/client_advanced.html#proxy-support |
Yes sir I did, it was the first way I did it and I'm getting the error I last described. I unfortunately went hunting for and answer to why the current way wasn't working for me and stumbled upon old documents and getting further confused with how to remedy my problem. I am having this problem doing it the new way:
|
Long story short
My problem is I really want to use aiohttp with asyncio to get Bing search engine results. My biggest problem is I've been trying to figure this out for days now. I've looked over many, MANY different discussions on the topic here (mostly here) and elsewhere.
Expected behaviour
The expected behavior is - using publicly available proxies (which can be many different type like Socks and regular CONNECT proxies etc. I do have a internal proxy server (http://127.0.0.1:8080) I'm using now to test, it gets public proxies, tests them and sets it on the server proxy. This server works fine.
I think for just a moment this morning I had it, I was testing against whatsmyip.org and I believe I did see I was 'broadcasting' from a different IP, but just like that I can't get it to work. I don't know what's going on. I am a novice, that is a problem as well too.
Actual behaviour
At first, I tried connecting using both http and https methods I was using for just regular 'request' method ... which was working out for me. When I wanted to switch to asyncio/aiohttp method I see I can't use https and need to use CONNECT method to tunnel in (I guess on :443?) using the ProxyConnector and setting up the proxy in the ClientSession.
Steps to reproduce
So, I'm using this guys code here which I like and it works great without proxies. I would like to use public proxies with this code here:
https://fadeevab.com/18-lines-of-the-powerful-request-generator-with-python-asyncio-aiohttp/
OK, so with this code above works fine, I need to connect public proxies to it.
Your environment
This here is the code I'm trying, it doesn't connect and I get back my own IP address each time. This is the code I was using that seems to have gotten me the closest to what I'm trying to accomplish ... but it's still telling me MY IP and not an IP from my proxy server. I have to put the code conn = None to get going, that seems sloppy to me though, not sure.
Sincerest apologies!
It took me days to reach out for help, I know I needed to really put some work in first before contacting, 3 days was enough frustration to bring me here. I hope I'm not irratating anyone with my noobness, I just think aiohttp is fantastic and want to use it.
Thanks for any help, it is really REALLY appreciated.
The text was updated successfully, but these errors were encountered: