Git Product home page Git Product logo

bluet / proxybroker2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from constverum/proxybroker

678.0 15.0 107.0 7.87 MB

The New (auto rotate) Proxy [Finder | Checker | Server]. HTTP(S) & SOCKS :performing_arts:

License: Apache License 2.0

Python 98.78% Dockerfile 0.47% Shell 0.75%
proxy proxy-server proxies proxy-list proxypool proxy-checker proxychains crawler crawling http-proxy https-proxy anonymity privacy anonymous socks hacktoberfest

proxybroker2's Introduction

Porting to Python3.10+ is painful and the progress is moving slowly.
We need more volunteers to join. PRs welcome! 😂

ProxyBroker

All Contributors

Quality Gate Status test result GitHub issues GitHub stars GitHub forks GitHub license Twitter

ProxyBroker is an open source tool that asynchronously finds public proxies from multiple sources and concurrently checks them.

image

Features

  • Finds more than 7000 working proxies from ~50 sources.
  • Support protocols: HTTP(S), SOCKS4/5. Also CONNECT method to ports 80 and 23 (SMTP).
  • Proxies may be filtered by type, anonymity level, response time, country and status in DNSBL.
  • Work as a proxy server that distributes incoming requests to external proxies. With automatic proxy rotation.
  • All proxies are checked to support Cookies and Referer (and POST requests if required).
  • Automatically removes duplicate proxies.
  • Is asynchronous.

Docker

Docker Hub https://hub.docker.com/r/bluet/proxybroker2

$ docker run --rm bluet/proxybroker2 --help
  usage: proxybroker [--max-conn MAX_CONN] [--max-tries MAX_TRIES]
                     [--timeout SECONDS] [--judge JUDGES] [--provider PROVIDERS]
                     [--verify-ssl]
                     [--log [{NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}]]
                     [--min-queue MINIMUM_PROXIES_IN_QUEUE]
                     [--version] [--help]
                     {find,grab,serve,update-geo} ...

  Proxy [Finder | Checker | Server]

  Commands:
    These are common commands used in various situations

    {find,grab,serve,update-geo}
      find                Find and check proxies
      grab                Find proxies without a check
      serve               Run a local proxy server
      update-geo          Download and use a detailed GeoIP database

  Options:
    --max-conn MAX_CONN   The maximum number of concurrent checks of proxies
    --max-tries MAX_TRIES
                          The maximum number of attempts to check a proxy
    --timeout SECONDS, -t SECONDS
                          Timeout of a request in seconds. The default value is
                          8 seconds
    --judge JUDGES        Urls of pages that show HTTP headers and IP address
    --provider PROVIDERS  Urls of pages where to find proxies
    --verify-ssl, -ssl    Flag indicating whether to check the SSL certificates
    --min-queue MINIMUM_PROXIES_IN_QUEUE   The minimum number of proxies in the queue for checking connectivity
    --log [{NOTSET,DEBUG,INFO,WARNING,ERROR,CRITICAL}]
                          Logging level
    --version, -v         Show program's version number and exit
    --help, -h            Show this help message and exit

  Run 'proxybroker <command> --help' for more information on a command.
  Suggestions and bug reports are greatly appreciated:
  <https://github.com/bluet/proxybroker2/issues>

Requirements

Installation

Install locally

To install last stable release from pypi:

NOT RECOMMEND. It will install the out-dated original proxybroker package, which is no longer maintained by original maintainer. https://github.com/constverum/ProxyBroker We will upload the up-to-date package under new name (proxybroker2) when the support for 3.10 is ready. #89

$ pip install proxybroker

To install the latest development version from GitHub:

$ pip install -U git+https://github.com/bluet/proxybroker2.git

Use pre-built Docker image

$ docker pull bluet/proxybroker2

Build bundled one-file executable with pyinstaller

Requirements

Supported Operating System: Windows, Linux, MacOS

On UNIX-like systems (Linux / macOSX / BSD)

Install these tools

  • upx
  • objdump (this tool is usually in the binutils package)
$ sudo apt install -y upx-ucl binutils # On Ubuntu / Debian

Build

pip install pyinstaller \
&& pip install . \
&& mkdir -p build \
&& cd build \
&& pyinstaller --onefile --name proxybroker --add-data "../proxybroker/data:data" --workpath ./tmp --distpath . --clean ../py2exe_entrypoint.py \
&& rm -rf tmp *.spec

The executable is now in the build directory

Usage

CLI Examples

Find

Find and show 10 HTTP(S) proxies from United States with the high level of anonymity:

$ proxybroker find --types HTTP HTTPS --lvl High --countries US --strict -l 10

image

Grab

Find and save to a file 10 US proxies (without a check):

$ proxybroker grab --countries US --limit 10 --outfile ./proxies.txt

image

Serve

Run a local proxy server that distributes incoming requests to a pool of found HTTP(S) proxies with the high level of anonymity:

$ proxybroker serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl High --min-queue 5

image

Run proxybroker --help for more information on the options available. Run proxybroker <command> --help for more information on a command.

Basic code example

Find and show 10 working HTTP(S) proxies:

import asyncio
from proxybroker import Broker

async def show(proxies):
    while True:
        proxy = await proxies.get()
        if proxy is None: break
        print('Found proxy: %s' % proxy)

proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(
    broker.find(types=['HTTP', 'HTTPS'], limit=10),
    show(proxies))

loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)

More examples.

Proxy information per requests

HTTP

Check X-Proxy-Info header in response.

$ http_proxy=http://127.0.0.1:8888 https_proxy=http://127.0.0.1:8888 curl -v http://httpbin.org/get
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET http://httpbin.org/get HTTP/1.1
> Host: httpbin.org
> User-Agent: curl/7.58.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< X-Proxy-Info: 174.138.42.112:8080
< Date: Mon, 04 May 2020 03:39:40 GMT
< Content-Type: application/json
< Content-Length: 304
< Server: gunicorn/19.9.0
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< X-Cache: MISS from ADM-MANAGER
< X-Cache-Lookup: MISS from ADM-MANAGER:880
< Connection: keep-alive
<
{
  "args": {},
  "headers": {
    "Accept": "*/*",
    "Cache-Control": "max-age=259200",
    "Host": "httpbin.org",
    "User-Agent": "curl/7.58.0",
    "X-Amzn-Trace-Id": "Root=1-5eaf8e7c-6a1162a1387a1743a49063f4"
  },
  "origin": "...",
  "url": "http://httpbin.org/get"
}
* Connection #0 to host 127.0.0.1 left intact

HTTPS

We are not able to modify HTTPS traffic to inject custom header once they start being encrypted. A X-Proxy-Info will be sent to client after HTTP/1.1 200 Connection established but not sure how clients can read it.

(env) bluet@ocisly:~/workspace/proxybroker2$ http_proxy=http://127.0.0.1:8888 https_proxy=http://127.0.0.1:8888 curl -v https://httpbin.org/get
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
* allocate connect buffer!
* Establish HTTP proxy tunnel to httpbin.org:443
> CONNECT httpbin.org:443 HTTP/1.1
> Host: httpbin.org:443
> User-Agent: curl/7.58.0
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 Connection established
< X-Proxy-Info: 207.148.22.139:8080
<
* Proxy replied 200 to CONNECT request
* CONNECT phase completed!
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
...
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x5560b2e93580)
> GET /get HTTP/2
> Host: httpbin.org
> User-Agent: curl/7.58.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 200
< date: Mon, 04 May 2020 03:39:35 GMT
< content-type: application/json
< content-length: 256
< server: gunicorn/19.9.0
< access-control-allow-origin: *
< access-control-allow-credentials: true
<
{
  "args": {},
  "headers": {
    "Accept": "*/*",
    "Host": "httpbin.org",
    "User-Agent": "curl/7.58.0",
    "X-Amzn-Trace-Id": "Root=1-5eaf8e77-efcb353b0983ad6a90f8bdcd"
  },
  "origin": "...",
  "url": "https://httpbin.org/get"
}
* Connection #0 to host 127.0.0.1 left intact

HTTP API

Get info of proxy been used for retrieving specific url

For HTTP, it's easy.

$ http_proxy=http://127.0.0.1:8888 https_proxy=http://127.0.0.1:8888 curl -v http://proxycontrol/api/history/url:http://httpbin.org/get
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET http://proxycontrol/api/history/url:http://httpbin.org/get HTTP/1.1
> Host: proxycontrol
> User-Agent: curl/7.58.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 34
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
<
{"proxy": "..."}

For HTTPS, we're not able to know encrypted payload (request), so only hostname can be used.

$ http_proxy=http://127.0.0.1:8888 https_proxy=http://127.0.0.1:8888 curl -v http://proxycontrol/api/history/url:httpbin.org:443
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET http://proxycontrol/api/history/url:httpbin.org:443 HTTP/1.1
> Host: proxycontrol
> User-Agent: curl/7.58.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< Content-Type: application/json
< Content-Length: 34
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
<
{"proxy": "..."}
* Connection #0 to host 127.0.0.1 left intact

Remove specific proxy from queue

$ http_proxy=http://127.0.0.1:8888 https_proxy=http://127.0.0.1:8888 curl -v http://proxycontrol/api/remove/PROXY_IP:PROXY_PORT
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8888 (#0)
> GET http://proxycontrol/api/remove/... HTTP/1.1
> Host: proxycontrol
> User-Agent: curl/7.58.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 204 No Content
<
* Connection #0 to host 127.0.0.1 left intact

Documentation

https://proxybroker.readthedocs.io/

TODO

  • Check the ping, response time and speed of data transfer
  • Check site access (Google, Twitter, etc) and even your own custom URL's
  • Information about uptime
  • Checksum of data returned
  • Support for proxy authentication
  • Finding outgoing IP for cascading proxy
  • The ability to specify the address of the proxy without port (try to connect on defaulted ports)

Contributing

  • Fork it: https://github.com/bluet/proxybroker2/fork
  • Create your feature branch: git checkout -b my-new-feature
  • We use Poetry to manage dependencies. If need, install dependencies: poetry install
  • Commit your changes: git commit -am 'Add some feature'
  • Push to the branch: git push origin my-new-feature
  • Submit a pull request!
  • Contributor workflow

License

Licensed under the Apache License, Version 2.0

This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com.

Refs

Contributors ✨

Thanks goes to these wonderful people (emoji key):

a5r0n
a5r0n

💻
C.M. Yang
C.M. Yang

💻 🤔 👀
Ivan Villareal
Ivan Villareal

💻
Quancore
Quancore

💻
Felipe
Felipe

🤔
vincentinttsh
vincentinttsh

💻 👀
Ziloka
Ziloka

💻
hms5232
hms5232

💻
Stefan Machmeier
Stefan Machmeier

💻
steven
steven

📖

This project follows the all-contributors specification. Contributions of any kind welcome!

proxybroker2's People

Contributors

a5r0n avatar afuntw avatar allcontributors[bot] avatar bluet avatar constverum avatar dannyeuu avatar dependabot-preview[bot] avatar dependabot[bot] avatar gabrielgradinaru avatar hms5232 avatar ivaano avatar lookyan avatar marado avatar oleskii avatar pykler avatar quancore avatar silversteven avatar snyk-bot avatar stefandeveloper avatar sweep-ai[bot] avatar tehkost avatar vincentinttsh avatar xnnd1 avatar ziloka avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

proxybroker2's Issues

How do I properly use this?

I've been trying to get this working for a good 2 hours now and I can't seem to get serve to work. At first I couldn't run proxybroker at all on windows due to aiodns being depreciated among other issues so I pulled the docker container. After about 45 minutes I was able to get it running and working with the find command but when I launch a serve instance withdocker run --rm -p 8888:8888 bluet/proxybroker2 --log CRITICAL serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl High --min-queue 5 I at least got it running but then when I tried to see if it was working by going to localhost:8888 i got a 400 error after changing the host to 0.0.0.0 so I figured it was working but when I add it to my proxy settings and check my ip I got a different ip ONCE and then it went back to my normal ip but the console shows no connections so idek if it's getting anything.
What do I need to do to get this working properly?

Release proxybroker2 module to pypi

Summary

Hi @bluet, inspired from #28, but we need to complete the following pre-work

  • Revise the pack scripts setup.py
  • Revise the dependency
  • Clear codebase architecture and documentation
  • Clear define how to contribute to this repo
  • Roadmap
  • Add coverage-test e.g. pytest-cov
  • Add workflow to test package on different platforms e.g. Windows and macOS
  • De-fork

Getting error when running from pip install

So i am getting this error on windows with the pip installed version of it.
With Python 3.11.1 Running this command proxybroker find --types HTTP HTTPS --lvl High --countries US --strict -l 10

I get this error
File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "C:\Users\mrmwg\AppData\Local\Programs\Python\Python311\Scripts\proxybroker.exe\__main__.py", line 7, in <module> File "C:\Users\mrmwg\AppData\Local\Programs\Python\Python311\Lib\site-packages\proxybroker\cli.py", line 380, in cli proxies = asyncio.Queue(loop=loop) ^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: Queue.__init__() got an unexpected keyword argument 'loop'

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches black
[pipenv.exceptions.ResolutionFailure]:       Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0
There are incompatible versions in the resolved dependencies.

['Traceback (most recent call last):\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 501, in create_spinner\n    yield sp\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 649, in venv_resolve_deps\n    c = resolve(cmd, sp)\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 539, in resolve\n    sys.exit(c.return_code)\n', 'SystemExit: 1\n']

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

the example hangs after first execution

When I run find_and_save example, it is working as expected. However, when I run the script after the second or third time sequentially, it gives lots of timeout error and not scraping any proxies. The expected behavior is the start from scratch and scrapes all proxies again.

Fix latest build arm64 support

Describe the bug
Latest build doesn't work with arm64, there is only an amd64 tag.

To Reproduce
Steps to reproduce the behavior:

  1. From an arch system, "export DOCKER_DEFAULT_PLATFORM=linux/arm64"
  2. Run "docker-compose up proxybroker2" with appropriate docker-compose.yml file
  3. "WARNING: image with reference bluet/proxybroker2 was found but does not match the specified platform: wanted linux/arm64, actual: linux/amd64
  4. When running, "exec /usr/local/bin/python: exec format error"

Expected behavior
When pulling / building from Dockerhub, arm64 support

Desktop (please complete the following information):

  • OS: Ubuntu Server 22.04.1 LTS

Poetry as the only package manager?

Follow-up discussion of #92

@hms5232 got your point 👌

@afunTW I don't think we can/should generate/update requirements.txt in CI pipeline. CI shouldn't make changes to the source repo, isn't it?
IIRC, the export command of Poetry can be used to generate requirements.txt. So, in practice, we can either ask developers to remember to run the command every time they update dependency, or just document the generation command in README.md for users who really want to use requirements.txt. 🤣
Not sure if there are other ways.

OSError: [WinError 10038] An operation was attempted on something that is not a socket

Hello, I'm having issues with the library, this is the stacktrace it threw:

1.09.74.59:476: Error at creating: 
Traceback (most recent call last):
  File "C:/Users/boxxo/PycharmProjects/proxy_scraper/proxyScraper.py", line 238, in <module>
    loop.run_until_complete(tasks)
  File "C:\ProgramData\Anaconda3\envs\proxy_scraper\lib\asyncio\base_events.py", line 475, in run_until_complete
    self.run_forever()
  File "C:\ProgramData\Anaconda3\envs\proxy_scraper\lib\asyncio\base_events.py", line 442, in run_forever
    self._run_once()
  File "C:\ProgramData\Anaconda3\envs\proxy_scraper\lib\asyncio\base_events.py", line 1426, in _run_once
    event_list = self._selector.select(timeout)
  File "C:\ProgramData\Anaconda3\envs\proxy_scraper\lib\selectors.py", line 323, in select
    r, w, _ = self._select(self._readers, self._writers, [], timeout)
  File "C:\ProgramData\Anaconda3\envs\proxy_scraper\lib\selectors.py", line 314, in _select
    r, w, x = select.select(r, w, w, timeout)
OSError: [WinError 10038] An operation was attempted on something that is not a socket

Process finished with exit code 1

and these are the functions, even shown in the examples I ran:

def run_broker(limit_amnt):
    """
        Run the broker lib functions to find proxies and call the save function asyncronously
    """
    try:
        proxies = asyncio.Queue()
        broker = Broker(proxies)
        tasks = asyncio.gather(broker.find(types=['HTTP', 'HTTPS'], limit=limit_amnt),
                                save(proxies, filename=pathTextFile))
        #tasks = asyncio.gather(
        #   broker.find(types=['HTTP', 'HTTPS'], limit=100),
        #   show(proxies))
        loop = asyncio.get_event_loop()
        loop.run_until_complete(tasks)
    except:
        logging.error(traceback.format_exc())

async def save(proxies, filename):
    """Save proxies to a file."""
    with open(filename, 'w') as f:
        while True:
            proxy = await proxies.get()
            if proxy is None:
                break
            proto = 'https' if 'HTTPS' in proxy.types else 'http'
            row = '%s://%s:%d\n' % (proto, proxy.host, proxy.port)
            f.write(row)

Could anyone help me with it?

Send Proxy-Info back to client in HTTP Header.

I've added a feature for removing proxy from queue by client (starting from constverum@c9e58a0), but it would still be useless if clients are not able to know which proxy are they using.

If we can add a X-Proxy-Info header in response to client, it would make life much easier.

example: X-Proxy-Info: proxy1.localtest.me:8080

NotImplementedError on Windows Python 3.8+

Running proxybroker from CLI has been broken for me on any Python version >= 3.8

Traceback (most recent call last):
File "c:\users\user\appdata\local\programs\python\python38\lib\site-packages\pycares_init_.py", line 99, in sock_state_cb
sock_state_cb(socket_fd, readable, writable)
File "c:\users\user\appdata\local\programs\python\python38\lib\site-packages\aiodns_init
.py", line 111, in _sock_state_cb
self.loop.add_reader(fd, self._handle_event, fd, READ)
File "c:\users\user\appdata\local\programs\python\python38\lib\asyncio\events.py", line 501, in add_reader
raise NotImplementedError

Apparently, Python 3.8 introduced a backwards-incompatible change to asyncio.
https://docs.python.org/3/library/asyncio-platforms.html#asyncio-platform-support
https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.loop.add_reader

Some people suggested adding the following code to fix it:

import sys

if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
Checklist
  • proxybroker/cli.py

• At the top of the file, after the import statements, add the following code:

import sys
import asyncio

if sys.platform == 'win32':
    asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

This code checks if the current platform is Windows ('win32'), and if so, it sets the event loop policy to WindowsSelectorEventLoopPolicy.

Getting lots of warning messages on Python 3.8.2

harry@ubuntu20:~$ proxybroker find --types HTTPS -l 50
/home/harry/.local/lib/python3.8/site-packages/proxybroker/cli.py:395: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  proxies = asyncio.Queue(loop=loop)
/usr/lib/python3.8/asyncio/queues.py:48: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  self._finished = locks.Event(loop=loop)
/home/harry/.local/lib/python3.8/site-packages/proxybroker/api.py:97: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  self._on_check = asyncio.Queue(maxsize=max_conn, loop=self._loop)
/home/harry/.local/lib/python3.8/site-packages/aiohttp/connector.py:964: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  hosts = await asyncio.shield(self._resolve_host(
/home/harry/.local/lib/python3.8/site-packages/aiohttp/locks.py:21: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  self._event = asyncio.Event(loop=loop)
/usr/lib/python3.8/asyncio/trsock.py:20: DeprecationWarning: Using send() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
  warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.8/asyncio/trsock.py:20: DeprecationWarning: Using recv() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
  warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback
/usr/lib/python3.8/asyncio/trsock.py:20: DeprecationWarning: Using close() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
  warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback

How to convert this ProxyBroker script to exe?

How to convert this script to exe?
I would like to get a Windows binary to search for proxies. So that I could run from a flash drive.
Very good script.
But I can't compile. Or maybe you already have a compiled version?
I've tried auto-py-to-exe but it doesn't work.Thanks

Freeze after a while when limit not set

After waiting a while when a limit is not set. Proxybroker will stop finding proxies. Is this normal? Shouldn't it find and update proxy lists from providers every time?

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2, 21.5b0, 21.5b0
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches black
[pipenv.exceptions.ResolutionFailure]:       Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2, 21.5b0, 21.5b0
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2, 21.5b0, 21.5b0
There are incompatible versions in the resolved dependencies.

['Traceback (most recent call last):\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 501, in create_spinner\n    yield sp\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 649, in venv_resolve_deps\n    c = resolve(cmd, sp)\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 539, in resolve\n    sys.exit(c.return_code)\n', 'SystemExit: 1\n']

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

What is contributor workflow

I'm not very experienced with python and I just did my first PR for this project. What is your developer workflow?
I usually just write my code, and run pip install . and test it.

Server type not displaying and --types not working

The brackets where the type of the server is supposed to be displayed is empty, and when i try to use the --types argument i have
proxybroker2: error: unrecognized arguments: --types SOCKS5

Capture d’écran du 2023-03-05 22-31-21

Capture d’écran du 2023-03-05 22-33-27

I am currently using the latest version of ubuntu.

Suggestions to de-fork

It seems that the @constverum stopped the activity for some reason. And proxybroker is out of maintenance.

Currently, your branch is the most active. I think the proxybroker community should move here and continue developping.

So I suggest you to contact GitHub Support to apply for de-fork. If successful, proxybroker2 will appear in the search results on GitHub.
I also suggest uploading proxybroker2 to pypi.

Before that, if you also think proxybroker2 should be independent, we can post a issue in proxybroker to notify everyone to come here.

The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.

┌──(root💀kali)-[/opt]
└─# proxybroker find --type SOCKS5 --lvl High --limit 10
/usr/local/lib/python3.9/dist-packages/proxybroker/cli.py:383: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
proxies = asyncio.Queue(loop=loop)
/usr/lib/python3.9/asyncio/queues.py:48: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
self._finished = locks.Event(loop=loop)
/usr/local/lib/python3.9/dist-packages/proxybroker/api.py:100: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
self._on_check = asyncio.Queue(maxsize=max_conn, loop=self._loop)
<Proxy IN 3.10s [SOCKS5] 43.224.10.43:6667>

Observations--not complaint

I have installed proxybroker several times using different process pip etc. There were times it conflicted with other programs. There were times it would only work for US proxies. Finally I installed in a virtualenv using pip and the developmental version. It only scrapped US proxies. So I said to myself, "Self, I wonder what would happen if I started and EU based VPN?" So stopped the program, virtual environment, started a vpn in the Netherlands, restarted the virtualenv, and what happened? Proxybroker not only worked but scraped other countries as well. So the problems, for me, were tricky installation and possible mischief with my ISP.
All of this was done on Kali Linux 2023-2 live usb.

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches black
[pipenv.exceptions.ResolutionFailure]:       Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1
There are incompatible versions in the resolved dependencies.

['Traceback (most recent call last):\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 501, in create_spinner\n    yield sp\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 649, in venv_resolve_deps\n    c = resolve(cmd, sp)\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 539, in resolve\n    sys.exit(c.return_code)\n', 'SystemExit: 1\n']

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Proxy Broker in windows 11

Hi, i opened a sandbox (win11) with python 3.8 and i installed the 3 requirement to start the script but it doesn't work. I have to open setup.py, right?

How can i static ip?

System: ubuntu 20.04, centos 7.9

command serve

how can i static ip?

I test with “serve” and it working

i use proxy and add it into extension oxylabs proxy chrome, and then check ip into the web https://whatismyipaddress.com is ok.

But when i watch youtube about 1 mimutes, and check ip again, it change?
And repeat the action, and it change again and again.

How can i control the ip, in case stop the change it and make it static?

thank for read and support.

tracemalloc error

Not sure if this is hindering any functionality of tool I get results as expected but this shows up everytime I run this tool

/usr/local/lib/python3.10/dist-packages/proxybroker/cli.py:443: DeprecationWarning: There is no current event loop
loop.run_until_complete(asyncio.gather(*tasks))
/usr/lib/python3.10/asyncio/trsock.py:20: DeprecationWarning: Using send() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
warnings.warn(

serve socks5 is slow and broken

check latest docker image:

docker images | grep proxy
bluet/proxybroker2         latest          0d842236e4e0   6 days ago      179MB

it can find:

$ docker run --rm bluet/proxybroker2 --log INFO find --types SOCKS5 --lvl High --countries US UK DE FR NL --strict -l 10
<Proxy US 0.97s [SOCKS5] 184.178.172.13:15311>
<Proxy US 0.97s [SOCKS5] 98.162.25.29:31679>
<Proxy US 1.04s [SOCKS5] 72.210.252.134:46164>
<Proxy US 1.04s [SOCKS5] 184.178.172.28:15294>
<Proxy US 1.05s [SOCKS5] 184.178.172.25:15291>
<Proxy US 1.30s [SOCKS5] 184.178.172.18:15280>
<Proxy US 3.59s [SOCKS5] 72.49.49.11:31034>
<Proxy US 3.59s [SOCKS5] 66.42.224.229:41679>
<Proxy US 1.38s [SOCKS5] 184.178.172.5:15303>
[22:55:40] - ERROR - proxybroker - 066.29.154.103:3128: Error at creating: 
[22:55:40] - INFO - proxybroker - Done! Total found proxies: 1754
<Proxy US 0.26s [SOCKS5] 174.64.199.79:4145>

and list is valid:

$ curl --socks5 184.178.172.13:15311 http://httpbin.org/ip
{
  "origin": "184.178.172.13"
}

but serve miss found earlier items and load something another:

$ docker run --rm bluet/proxybroker2 --log INFO serve --host 127.0.0.1 --port 8888 --types SOCKS5 --lvl High --countries UK DE FR NL --min-queue 5
/usr/local/lib/python3.9/asyncio/events.py:80: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  self._context.run(self._callback, *self._args)
Server started at http://127.0.0.1:8888
[22:56:10] - INFO - proxybroker - Listening established on ('127.0.0.1', 8888)
[22:56:29] - ERROR - proxybroker - 047.88.6.66:4672: Error at creating: 
[22:56:30] - ERROR - proxybroker - 068.183.98.123:3128: Error at creating: 
[22:56:32] - ERROR - proxybroker - 072.210.252.134:46164: Error at creating: 
[22:56:33] - ERROR - proxybroker - 047.91.57.156:3000: Error at creating: 
[22:56:33] - ERROR - proxybroker - 071.19.249.118:8001: Error at creating: 
[22:56:35] - ERROR - proxybroker - 080.48.119.28:8080: Error at creating: 
[22:56:35] - ERROR - proxybroker - 094.74.117.93:2526: Error at creating: 
[22:56:54] - ERROR - proxybroker - 043.225.140.143:3000: Error at creating: 
[22:56:54] - ERROR - proxybroker - 03.144.188.184:8080: Error at creating: 
[22:56:57] - ERROR - proxybroker - 066.29.154.103:3128: Error at creating: 
[22:56:57] - ERROR - proxybroker - 045.79.27.210:1080: Error at creating: 
[22:56:59] - ERROR - proxybroker - 066.29.154.105:3128: Error at creating: 
[22:56:59] - ERROR - proxybroker - 05.153.234.91:3128: Error at creating: 
[22:57:00] - ERROR - proxybroker - 045.169.162.1:3128: Error at creating: 
[22:57:03] - ERROR - proxybroker - 047.88.8.118:3000: Error at creating: 
[23:00:49] - ERROR - proxybroker - 103.250.166.04:6667: Error at creating: 
^C[23:01:00] - INFO - proxybroker - Done! Total found proxies: 30726
[23:01:00] - INFO - proxybroker - Server is stopped
[23:01:00] - INFO - proxybroker - Stop!

As you see counter is 30726. And "find counter" equal 1754.
This indicates that the serve method is skipping valid records and this is the reason for the slow work.

second problem: "broken" proxy really worked

$ curl --socks5 47.88.6.66:4672 http://httpbin.org/ip
{
  "origin": "47.88.6.66"
}

Expected behavior
1/ serve method not missing element, accessible in find
2/ serve method correctly identify negotiability of proxies

Environment
Docker image

{
    "Id": "sha256:0d842236e4e016fcd811ca79588b7876434c420224eccd5081d845d75963a36e",
    "RepoTags": [
        "bluet/proxybroker2:latest"
    ],
    "RepoDigests": [
        "bluet/proxybroker2@sha256:9a19953e4789aa211b0ce5338b2b644831b111702e19ac93eb0cd1fd27eca0aa"
    ],
    "Created": "2022-08-30T21:53:47.639486018Z"
    },
    Config": {
        "Env": [
            "PATH=/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "LANG=C.UTF-8",
            "GPG_KEY=E3FF2839C048B25C084DEBE9B26995E310250568",
            "PYTHON_VERSION=3.9.13",
            "PYTHON_PIP_VERSION=22.0.4",
            "PYTHON_SETUPTOOLS_VERSION=58.1.0",
            "PYTHON_GET_PIP_URL=https://github.com/pypa/get-pip/raw/5eaac1050023df1f5c98b173b248c260023f2278/public/get-pip.py",
            "PYTHON_GET_PIP_SHA256=5aefe6ade911d997af080b315ebcb7f882212d070465df544e1175ac2be519b4",
            "PYTHONDONTWRITEBYTECODE=1",
            "PYTHONUNBUFFERED=1",
            "PIP_NO_CACHE_DIR=1",
            "PIP_DISABLE_PIP_VERSION_CHECK=1"
        ],
    },
    "Architecture": "amd64",
    "Os": "linux"
}

Also tested in ubuntu and virtualenv in Python 3.8.10. Installatin via pip install -U git+https://github.com/bluet/proxybroker2.git today.

serve fails with https requests

with version 0.4.0
proxybroker --log DEBUG serve --host 0.0.0.0 --port 9443 --types SOCKS4 --countries KR

 curl https://ipinfo.io/json --proxy https://127.0.0.1:9443
curl: (35) gnutls_handshake() failed: The TLS connection was non-properly terminated.

but it works fine with http

[megamind@ssdnodes-89316]:(33.8kb)~$ curl http://ipinfo.io/json --proxy http://127.0.0.1:9443
{
  "ip": "112.219.201.124",
  "city": "Bucheon-si",
  "region": "Gyeonggi-do",
  "country": "KR",
  "loc": "37.4989,126.7831",
  "org": "AS3786 LG DACOM Corporation",
  "postal": "14550",
  "timezone": "Asia/Seoul",
  "readme": "https://ipinfo.io/missingauth"

with version 0.3.2
proxybroker --log DEBUG serve --host localhost --port 8855 --types SOCKS4 --countries KR

curl https://ipinfo.io/ip --proxy https://127.0.0.1:8855
222.121.116.26

NotImplementedError:

For the given code:

import asyncio
from proxybroker import Broker

async def show(proxies):
while True:
proxy = await proxies.get()
if proxy is None:
break
print("Found proxy: %s" % proxy)

proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(broker.find(types=["HTTP", "HTTPS"], limit=10), show(proxies))

loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)

I am getting this 10 times:

Exception ignored from cffi callback <function sock_state_cb at 0x000001A7DF3798A0>:
Traceback (most recent call last):
File "C:\Users\koush\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\pycares_init
.py", line 99, in sock_state_cb
sock_state_cb(socket_fd, readable, writable)
File "C:\Users\koush\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\aiodns_init
.py", line 111, in _sock_state_cb
self.loop.add_reader(fd, self._handle_event, fd, READ)
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.11_3.11.1264.0_x64__qbz5n2kfra8p0\Lib\asyncio\events.py", line 530, in add_reader
raise NotImplementedError
NotImplementedError:

how to fix bro? also no proxy is showing
Screenshot 2023-07-05 122318

Docker serve not working, but ran pip working ok

System: ubuntu 20.04 & Centos 7.9
Python: 3.9.0

Comand: docker run -it --rm bluet/proxybroker2 serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl High --min-queue 5

Logs:
/usr/local/lib/python3.9/asyncio/events.py:80: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
self._context.run(self._callback, *self._args)
Server started at http://127.0.0.1:8888
/usr/local/lib/python3.9/asyncio/trsock.py:20: DeprecationWarning: Using send() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.9/asyncio/trsock.py:20: DeprecationWarning: Using recv() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.9/asyncio/trsock.py:20: DeprecationWarning: Using close() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback

I check port open with command: “netstat -lpnt”
And don’t see it had open 8888

But a test with command:
proxybroker serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl High --min-queue 5

And it working ok, had port open 8888
“127.0.0.1:8888”

What happen with docker?

How to grab only http - https

System: Centos 7.9

Command:
proxybroker grab --limit 10 --outfile ./proxies.txt --countries US
cat proxies.txt

Resulf:
<Proxy US 0.00s [] 98.188.47.132:4145>
<Proxy US 0.00s [] 104.200.135.46:4145>
<Proxy US 0.00s [] 184.178.172.26:4145>
<Proxy US 0.00s [] 184.170.245.148:4145>
<Proxy US 0.00s [] 167.71.73.130:33035>
<Proxy US 0.00s [] 174.77.111.196:4145>
<Proxy US 0.00s [] 66.29.128.243:52645>
<Proxy US 0.00s [] 98.175.31.195:4145>
<Proxy US 0.00s [] 8.42.68.109:39593>
<Proxy US 0.00s [] 192.252.214.20:15864>

And i check it all SOCKS(4/5)

How can i get only http/https?

Thank for read it

Is this project still working

I tried to run the project and test it but no success.

Command I have used:

sudo docker run --rm -p 8888:8888 bluet/proxybroker2 --log CRITICAL serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl High --min-queue 5

It prints this:

/usr/local/lib/python3.9/asyncio/events.py:80: DeprecationWarning: The loop argument is deprecated since Python 3.8, and scheduled for removal in Python 3.10.
  self._context.run(self._callback, *self._args)
Server started at http://127.0.0.1:8888
/usr/local/lib/python3.9/asyncio/trsock.py:20: DeprecationWarning: Using send() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
  warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.9/asyncio/trsock.py:20: DeprecationWarning: Using recv() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
  warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback
/usr/local/lib/python3.9/asyncio/trsock.py:20: DeprecationWarning: Using close() method on sockets returned from get_extra_info('socket') will be prohibited in asyncio 3.9. Please report your use case to bugs.python.org.
  warnings.warn(
DeprecationWarning: Enable tracemalloc to get the object allocation traceback

Then I tried using http (CLI, installed via sudo snap install http then export HTTP_PROXY=http://127.0.0.1:8888 and export HTTP_PROXY=http://127.0.0.1:8888). The command used is http http://ifconfig.me. This tool returns the following:

http: error: ProxyError: HTTPConnectionPool(host='127.0.0.1', port=8888): Max retries exceeded with url: http://ifconfig.me/ (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer'))) while doing a GET request to URL: http://ifconfig.me/

HTTPConnectionPool(host='127.0.0.1', port=8888): Max retries exceeded with url: http://ifconfig.me/ (Caused by ProxyError('Cannot connect to proxy.', ConnectionResetError(104, 'Connection reset by peer')))

`

`

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches black
[pipenv.exceptions.ResolutionFailure]:       Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1
There are incompatible versions in the resolved dependencies.

['Traceback (most recent call last):\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 501, in create_spinner\n    yield sp\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 649, in venv_resolve_deps\n    c = resolve(cmd, sp)\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 539, in resolve\n    sys.exit(c.return_code)\n', 'SystemExit: 1\n']

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

help

loop = asyncio.get_event_loop()
Traceback (most recent call last):
File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\david\AppData\Local\Programs\Python\Python310\Scripts\proxybroker.exe_main
.py", line 7, in
File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\site-packages\proxybroker\cli.py", line 386, in cli
proxies = asyncio.Queue(loop=loop)
File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\asyncio\queues.py", line 34, in init
super().init(loop=loop)
File "C:\Users\david\AppData\Local\Programs\Python\Python310\lib\asyncio\mixins.py", line 17, in init
raise TypeError(
TypeError: As of 3.10, the loop parameter was removed from Queue() since it is no longer necessary

Executing find command with any parameters throws "AttributeError: 'TransportSocket' object has no attribute 'close'"

Describe the bug
Using python 3.11, this error is thrown if using the program at all. (as a library or command line app)

To Reproduce
Steps to reproduce the behavior:

  1. Install proxybroker (the current HEAD)
pip install git+https://github.com/bluet/proxybroker2.git@d6736a3f7940c10dd64a1dcdb5152e00bc92ea23
  1. run find command
proxybroker find --types HTTP HTTPS --lvl High --countries US --strict -l 10
  1. see Error "AttributeError: 'TransportSocket' object has no attribute 'close'"

Expected behavior
Only see the results, and not errors

Screenshots
image

Desktop (please complete the following information):

  • OS: Debian Linux 11
  • Version commit d6736a3

Additional context
N/A

Serve proxies with one line of code

I think the code to get a list of proxies should be as simple as possible. So just make something like proxies = Broker.get_proxies(n). Maybe an optional parameter with the format of the strings.

def getProxies(n: int) -> List[str]:
    '''Return a list of n working proxies
    '''
    async def show(proxies):
        p = []
        while True:
                proxy = await proxies.get()
                if proxy is None: break
                p.append(f'{proxy.host}:{proxy.port}')
        return p
 
    proxies = asyncio.Queue()
    broker = Broker(proxies)
    tasks = asyncio.gather(broker.find(types=['HTTPS'], limit=n), show(proxies))
    loop = asyncio.get_event_loop()
    return loop.run_until_complete(tasks)[1]

Option to use own MaxmindDB

It would be nice to have an optional parameter to change the path of the Maxmind DB. We have a paid license and a more accurate database than the GeoLite edition

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2, 21.5b0, 21.5b0, 21.5b1, 21.5b1
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches black
[pipenv.exceptions.ResolutionFailure]:       Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2, 21.5b0, 21.5b0, 21.5b1, 21.5b1
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2, 21.5b0, 21.5b0, 21.5b1, 21.5b1
There are incompatible versions in the resolved dependencies.

['Traceback (most recent call last):\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 501, in create_spinner\n    yield sp\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 649, in venv_resolve_deps\n    c = resolve(cmd, sp)\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 539, in resolve\n    sys.exit(c.return_code)\n', 'SystemExit: 1\n']

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Issue on running the README quickstart script with python 3.8 interpreter

I tried the quickstart snippet on the readme:

import asyncio
from proxybroker import Broker

async def show(proxies):
    while True:
        proxy = await proxies.get()
        if proxy is None: break
        print('Found proxy: %s' % proxy)

proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(
    broker.find(types=['HTTP', 'HTTPS'], limit=10),
    show(proxies))

loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)

Which gave me this Traceback:
Traceback (most recent call last):
File "C:\Users\boxxo\PycharmProjects\pythonProject12\main.py", line 13, in
broker = Broker(proxies)
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\api.py", line 67, in init
self._loop = loop or asyncio.get_running_loop()
RuntimeError: no running event loop

To Reproduce
Steps to reproduce the behavior:

  1. New environment with conda which automatically adds to the env these packages:

ca-certificates | 2022.07.19 |  
certifi | 2022.9.24 |  
openssl | 1.1.1q |  
pip | 22.2.2 |  
python | 3.8.13 |  
setuptools | 63.4.1 |  
sqlite | 3.39.3 |  
vc | 14.2 |  
vs2015_runtime | 14.27.29016 |  
wheel | 0.37.1 |  
wincertstore | 0.2 |  

  1. pip install -U git+https://github.com/bluet/proxybroker2.git .

  2. run the snippet as described in the readme and stated above .

Expected behavior
Showing proxies in the console.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Not required
  • Version 11

Additional context
I also tried the below by creating a new loop and assigning it to the Broker constructor.

import asyncio
from proxybroker import Broker

async def show(proxies):
    while True:
        proxy = await proxies.get()
        if proxy is None: break
        print('Found proxy: %s' % proxy)

proxies = asyncio.Queue()
loop=asyncio.new_event_loop()

broker = Broker(proxies, loop=loop)
tasks = asyncio.gather(
    broker.find(types=['HTTP', 'HTTPS'], limit=10),
    show(proxies))

loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)

Which gave me this traceback:

C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\resolver.py:105: DeprecationWarning: The object should be created within an async function
async with aiohttp.ClientSession(
C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\connector.py:767: DeprecationWarning: The object should be created within an async function
super().init(
C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\cookiejar.py:67: DeprecationWarning: The object should be created within an async function
super().init(loop=loop)
Traceback (most recent call last):
File "C:\Users\boxxo\PycharmProjects\pythonProject12\main.py", line 19, in
loop.run_until_complete(tasks)
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\api.py", line 176, in find
ip = await self._resolver.get_real_ext_ip()
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\proxybroker\resolver.py", line 105, in get_real_ext_ip
async with aiohttp.ClientSession(
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\client.py", line 1141, in aenter
self._resp = await self._coro
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\client.py", line 467, in _request
with timer:
File "C:\Users\boxxo\anaconda3\envs\pythonProject12\lib\site-packages\aiohttp\helpers.py", line 700, in enter
raise RuntimeError(
RuntimeError: Timeout context manager should be used inside a task

I've read that it doesn't support python version 3.10 here : here but I think it should be supporting 3.9/3.8 ? Read it from this commit .

Also I've tried running the same script on a FastAPI instance and it works just fine on 3.8 (not tested yet in 3.9, if needed I can update you on this).

ERROR: Could not build wheels for pycares, which is required to install pyproject.toml-based projects

╰─➤ pip install -U git+https://github.com/bluet/proxybroker2.git 130 ↵
Defaulting to user installation because normal site-packages is not writeable
Collecting git+https://github.com/bluet/proxybroker2.git
Cloning https://github.com/bluet/proxybroker2.git to /tmp/pip-req-build-7fuwlfvf
Running command git clone --filter=blob:none --quiet https://github.com/bluet/proxybroker2.git /tmp/pip-req-build-7fuwlfvf
Resolved https://github.com/bluet/proxybroker2.git to commit d6736a3
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting aiohttp<4.0.0,>=3.8.1
Using cached aiohttp-3.8.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB)
Requirement already satisfied: attrs<23.0.0,>=22.1.0 in /home/denis/.local/lib/python3.11/site-packages (from proxybroker==2.0.0a4) (22.1.0)
Collecting cachetools<6.0.0,>=5.2.0
Using cached cachetools-5.2.0-py3-none-any.whl (9.3 kB)
Collecting maxminddb<3.0.0,>=2.2.0
Using cached maxminddb-2.2.0-py2.py3-none-any.whl
Collecting click<9.0.0,>=8.1.3
Using cached click-8.1.3-py3-none-any.whl (96 kB)
Collecting aiodns<4.0.0,>=3.0.0
Using cached aiodns-3.0.0-py3-none-any.whl (5.0 kB)
Collecting pycares>=4.0.0
Using cached pycares-4.2.2.tar.gz (825 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting aiosignal>=1.1.2
Using cached aiosignal-1.3.1-py3-none-any.whl (7.6 kB)
Requirement already satisfied: charset-normalizer<3.0,>=2.0 in /home/denis/.local/lib/python3.11/site-packages (from aiohttp<4.0.0,>=3.8.1->proxybroker==2.0.0a4) (2.1.1)
Collecting multidict<7.0,>=4.5
Using cached multidict-6.0.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (117 kB)
Collecting async-timeout<5.0,>=4.0.0a3
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting frozenlist>=1.1.1
Using cached frozenlist-1.3.3-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (154 kB)
Collecting yarl<2.0,>=1.0
Using cached yarl-1.8.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (278 kB)
Collecting cffi>=1.5.0
Using cached cffi-1.15.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (462 kB)
Requirement already satisfied: idna>=2.0 in /home/denis/.local/lib/python3.11/site-packages (from yarl<2.0,>=1.0->aiohttp<4.0.0,>=3.8.1->proxybroker==2.0.0a4) (3.4)
Collecting pycparser
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Building wheels for collected packages: proxybroker, pycares
Building wheel for proxybroker (pyproject.toml) ... done
Created wheel for proxybroker: filename=proxybroker-2.0.0a4-py3-none-any.whl size=1575248 sha256=32d8f6c90278c2dc423850ba30256c195fddbc7fb3f2b7ebef826f6645dc343b
Stored in directory: /tmp/pip-ephem-wheel-cache-si32e5vm/wheels/ed/a1/34/283a41bc42be90a139ef9f1899889e9e8d1f90f324f2f0c596
Building wheel for pycares (pyproject.toml) ... error
error: subprocess-exited-with-error

× Building wheel for pycares (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [25 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.11
creating build/lib.linux-x86_64-3.11/pycares
copying src/pycares/_version.py -> build/lib.linux-x86_64-3.11/pycares
copying src/pycares/main.py -> build/lib.linux-x86_64-3.11/pycares
copying src/pycares/errno.py -> build/lib.linux-x86_64-3.11/pycares
copying src/pycares/utils.py -> build/lib.linux-x86_64-3.11/pycares
copying src/pycares/init.py -> build/lib.linux-x86_64-3.11/pycares
running build_ext
creating build/temp.linux-x86_64-3.11
creating build/temp.linux-x86_64-3.11/build
creating build/temp.linux-x86_64-3.11/build/temp.linux-x86_64-3.11
creating build/temp.linux-x86_64-3.11/deps
creating build/temp.linux-x86_64-3.11/deps/c-ares
creating build/temp.linux-x86_64-3.11/deps/c-ares/src
creating build/temp.linux-x86_64-3.11/deps/c-ares/src/lib
x86_64-linux-gnu-gcc -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -DHAVE_CONFIG_H=1 -D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 -DCARES_STATICLIB=1 -Ideps/build-config/config_linux -Ideps/build-config/include -Ideps/c-ares/include -I/usr/include/python3.11 -c build/temp.linux-x86_64-3.11/_cares.c -o build/temp.linux-x86_64-3.11/build/temp.linux-x86_64-3.11/_cares.o
build/temp.linux-x86_64-3.11/_cares.c:50:14: fatal error: pyconfig.h: No such file or directory
50 | # include <pyconfig.h>
| ^~~~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycares
Successfully built proxybroker
Failed to build pycares
ERROR: Could not build wheels for pycares, which is required to install pyproject.toml-based projects

Dependabot can't resolve your Python dependency files

Dependabot can't resolve your Python dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2
There are incompatible versions in the resolved dependencies.
[pipenv.exceptions.ResolutionFailure]:       req_dir=requirements_dir
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 726, in resolve_deps
[pipenv.exceptions.ResolutionFailure]:       req_dir=req_dir,
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 480, in actually_resolve_deps
[pipenv.exceptions.ResolutionFailure]:       resolved_tree = resolver.resolve()
[pipenv.exceptions.ResolutionFailure]:   File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 395, in resolve
[pipenv.exceptions.ResolutionFailure]:       raise ResolutionFailure(message=str(e))
[pipenv.exceptions.ResolutionFailure]:       pipenv.exceptions.ResolutionFailure: ERROR: ERROR: Could not find a version that matches black
[pipenv.exceptions.ResolutionFailure]:       Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2
[pipenv.exceptions.ResolutionFailure]: Warning: Your dependencies could not be resolved. You likely have a mismatch in your sub-dependencies.
  First try clearing your dependency cache with $ pipenv lock --clear, then try the original command again.
 Alternatively, you can use $ pipenv install --skip-lock to bypass this mechanism, then run $ pipenv graph to inspect the situation.
  Hint: try $ pipenv lock --pre if it is a pre-release dependency.
ERROR: ERROR: Could not find a version that matches black
Skipped pre-versions: 18.3a0, 18.3a0, 18.3a1, 18.3a1, 18.3a2, 18.3a2, 18.3a3, 18.3a3, 18.3a4, 18.3a4, 18.4a0, 18.4a0, 18.4a1, 18.4a1, 18.4a2, 18.4a2, 18.4a3, 18.4a3, 18.4a4, 18.4a4, 18.5b0, 18.5b0, 18.5b1, 18.5b1, 18.6b0, 18.6b0, 18.6b1, 18.6b1, 18.6b2, 18.6b2, 18.6b3, 18.6b3, 18.6b4, 18.6b4, 18.9b0, 18.9b0, 19.3b0, 19.3b0, 19.10b0, 19.10b0, 20.8b0, 20.8b1, 21.4b0, 21.4b0, 21.4b1, 21.4b1, 21.4b2, 21.4b2
There are incompatible versions in the resolved dependencies.

['Traceback (most recent call last):\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 501, in create_spinner\n    yield sp\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 649, in venv_resolve_deps\n    c = resolve(cmd, sp)\n', '  File "/usr/local/.pyenv/versions/3.6.13/lib/python3.6/site-packages/pipenv/utils.py", line 539, in resolve\n    sys.exit(c.return_code)\n', 'SystemExit: 1\n']

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Thanks, but serve is not working?

Hi, is it just me, or serve is not working? It works for about an hour or less and then it stops working.

  • How can I check the logs of proxybroker? is there a log?

This is the setting I'm trying:
proxybroker serve --host 127.0.0.1 --port 8888 --types HTTPS --countries US --max-resp-time 4

I am running this process with immortal.run so that it's always on even if it crashes. But I've tried multiple times just running it as a regular shell process and after a while it always stops working, no matter how I run it (shell, nohup, immortal,...)

Proxy remove URL not work

i tryng to remove a broken proxy but any i do remove the proxy from the pool the proxy only get errors and the pool never remove them

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.