Closed k61n closed 1 month ago
I also tried to run the same configuration on mac with docker 4.30, even wrote following docker-compose.yaml file:
version: '3'
services:
v2ray-service:
build:
context: ./docker
dockerfile: Dockerfile
args:
TARGETPLATFORM: "linux/arm64"
TAG: "v5.16.1"
image: v2ray-client:v5.16.1
container_name: v2ray-client
ports:
- "1080:1080"
volumes:
- /Users/kk/work/docker/v2ray-client/files/etc/v2ray:/etc/v2ray
command: ["run", "-c", "/etc/v2ray/config.json"]
But without luck
I have managed to use the docker container as a proxy but only with http
protocol:
"inbounds": [
{
"port": 1080,
"listen": "0.0.0.0",
"protocol": "http"
}
],
And run docker container with --network host
argument instead exposing the 1080 port.
For me this container runs on dedicated raspberry pi, but might not be a suitable case for everyone.
So I believe the issue should stay open.
Ok, I think I got it.
I had two issues.
First issue is that config should listen 0.0.0.0
, not 127.0.0.1
. Otherwise one wouldn't be able to access the proxy outside of the container.
The second problem might be the docker versions.
I have v20 on debian11 and v24 on ubuntu20.04. It turns out that configuring socks
protocol in ubuntu and running the container with -p 1080:1080
or --network host
works fine, but not in debian11. In debian11 for some reason config with socks
refuses to work. Tt is still possible to run using http
protocol, tho.
Docker image is build with
v5.16.1
flag. Tried on debian 11 having docker 20.10.5 and on ubuntu 20.04 having docker 24.0.5. Tried this proxy configAnd this
docker ps:
I can run curl inside docker container to confirm client-server part works fine (server is in UK, me in another country):
However when I run curl in the host system:
I tried to add
EXPOSE 1080
to the Dockerfile, but it didn't help. I wonder what could be the problem? The docker network is fine. The container gets its IP and is pingable. If I try curl over its IP address in the docker network the result is the same. Should I use other type of proxy rather thansocks
? I need it so it would work with Firefox or other browser without any additional plugins.P.S. I have tried to setup proxy using
http
protocol. It works inside the docker container, however outside still something is wrong