Navigation X
ALERT
Click here to register with a few steps and explore all our cool stuff we have to offer!



 275

Hiring advanced golang developer. 150$

by RocketVilo - 12 January, 2024 - 08:59 PM
This post is by a banned member (RocketVilo) - Unhide
28
Posts
17
Threads
1 Year of service
#1
[Project Type]: Golang proxy server
[Compensation]: 150$ - can be discussed
[Current Project State]: 95%
[Programming Language]: Golang
Need some help making my proxy work for AIOHTTP. The issue lies with the proxy server need some help making it for asynchronous clients.

Doesnt work:
```python
import aiohttp
import random
import asyncio
from aiohttp_proxy import ProxyConnector, ProxyType


async def fetch():
    headers = {
        'User-Agent': 'Mozilla/5.0 ... Safari/537.36',
    }
    connector = ProxyConnector.from_url('http://127.0.0.1:1337')
    async with aiohttp.ClientSession(connector=connector) as session:
        try:
            async with session.get(
                    'https://google.com',
                    headers=headers, allow_redirects=False, timeout=10, ssl=False) as response:
                text = await response.text()
                print(text)
        except Exception as e:
            print(f"Error: {e}")


# Run the async function
asyncio.run(fetch())

```
Works:
```python
import requests

proxies = {
    'http': 'http://127.0.0.1:1337',
    'https': 'http://127.0.0.1:1337'
}

get = requests.get('https://google.com', proxies=proxies)
print(get.text)
````
https://t.me/ExiDev - scammers dont waste ur time
This post is by a banned member (metalliceye) - Unhide

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
or
Sign in
Already have an account? Sign in here.


Forum Jump:


Users browsing this thread: 1 Guest(s)