constverum / ProxyBroker

Proxy [Finder | Checker | Server]. HTTP(S) & SOCKS :performing_arts:
http://proxybroker.readthedocs.io
Apache License 2.0
3.87k stars 1.09k forks source link

Inaccessible proxy port when running in docker #167

Open jakubvedral opened 4 years ago

jakubvedral commented 4 years ago

Hi,

I am running proxybroker in docker and everything works fine - except serve mode.

docker run -p 8888:8888 -it davidsarkany/proxybroker serve --host 127.0.0.1 --port 8888 --types HTTP HTTPS --lvl Anonymous --strict -l 50

When I run this locally - directly from bash, everything works fine. Using docker it seems there is some broken connection inside container, because I am unable to connect to proxy broker inside docker.

I have tried several docker images listed on docker hub (even if i create my own) and always got the same result.

Is this known problem or should it be working ok?

Thank you

dwightgunning commented 4 years ago

--host 0.0.0.0 works for me with the Dockerfile below.

I'm not 100% clear on the ins and outs of it but by specifying 127.0.0.1, the app is likely not listening on the external (to the container) network interface.

FROM python:3.7.6-slim-stretch

ARG DEBIAN_FRONTEND=noninteractive
RUN apt -y update && apt -y install git && apt -y clean

ENV PYTHONUNBUFFERED=1
RUN pip install --upgrade pip
#RUN pip install proxybroker==0.3.2
RUN pip install -U git+https://github.com/constverum/ProxyBroker.git@d21aae8575fc3a95493233ecfd2c7cf47b36b069

CMD ["proxybroker", "--log", "DEBUG", "serve", "--host", "0.0.0.0", "--port", "9999", "--types", "HTTP", "HTTPS", "--lvl", "High", "-s", "--limit", "25"]
#CMD ["proxybroker", "--log", "DEBUG", "serve", "--host", "127.0.0.1", "--port", "9999", "--types", "HTTP", "HTTPS", "--lvl", "High", "-s", "--limit", "25"]