Open s4miii opened 5 years ago
Experiencing the same problems
I will add
docker exec mtproto-proxy curl http://localhost:2398/stats curl: (7) Failed to connect to localhost port 2398: Connection refused
@s4miii @Solbadguy Did you guys solve this ?
Recently installed and telegram not connecting at all. Curling
curl: (7) Failed to connect to localhost port {PORT}: Connection refused
Me too. Subscribe
It also happened for me today, apparently the fix from the issue 197 ( https://github.com/TelegramMessenger/MTProxy/issues/197#issuecomment-444445643 ) worked great, I have a debian 10 machine and changed /etc/systemd/timesyncd.conf to include a ntp server, then executed timedatectl set-ntp true
, restarted the mtproto proxy and now it works flawlessly.
Let's assume MTProxy
is started using docker compose
with the following configuration file:
version: '2.4'
services:
tgproxy:
image: telegrammessenger/proxy:1.4
volumes:
- ./proxy-config:/data
ports:
- 0.0.0.0:443:443
restart: unless-stopped
After running the container "as is", localhost:2398/stats
endpoint does not respond:
$ docker compose up -d tgproxy
[+] Running 1/2
⠸ Network tgproxy_default Created 0.4s
✔ Container tgproxy Started 0.4s
$ docker compose ps tgproxy
NAME IMAGE COMMAND SERVICE CREATED STATUS PORTS
tgproxy telegrammessenger/proxy:1.4 "/bin/sh -c '/bin/ba…" tgproxy 11 seconds ago Up 10 seconds 0.0.0.0:443->443/tcp
$ docker compose exec tgproxy curl -4sS http://localhost:2398/stats
curl: (7) Failed to connect to localhost port 2398: Connection refused
How to fix:
$ docker compose exec tgproxy tail -n1 -- /run.sh
exec /usr/local/bin/mtproto-proxy -p 2398 -H 443 -M "$WORKERS" -C 60000 --aes-pwd /etc/telegram/hello-explorers-how-are-you-doing -u root $CONFIG --allow-skip-dh --nat-info "$INTERNAL_IP:$IP" $SECRET_CMD $TAG_CMD
$ docker compose exec tgproxy sed -E -i -- "/--http-stats/! s#(/usr/local/bin/mtproto-proxy)#\1 --http-stats#" /run.sh
$ docker compose exec tgproxy tail -n1 -- /run.sh
exec /usr/local/bin/mtproto-proxy --http-stats -p 2398 -H 443 -M "$WORKERS" -C 60000 --aes-pwd /etc/telegram/hello-explorers-how-are-you-doing -u root $CONFIG --allow-skip-dh --nat-info "$INTERNAL_IP:$IP" $SECRET_CMD $TAG_CMD
$ docker compose exec tgproxy curl -4sS http://localhost:2398/stats
curl: (7) Failed to connect to localhost port 2398: Connection refused
$ docker compose exec tgproxy pkill -9 mtproto-proxy
$ docker compose exec tgproxy curl -4sS http://localhost:2398/stats
pid 7
start_time 1709043377
current_time 1709043378
uptime 1
tot_idle_time 1.454
...
pkill -9
is to force restart.
The same answer in Russian: https://ru.stackoverflow.com/a/1569227/177853
couple of months ago, I installed
Docker 18.09
on my Linux Server,4.4.0-145-generic #171-Ubuntu SMP Tue Mar 26 12:43:40 UTC 2019
Then I used this proxy for Telegram app,
docker run -d -p3032:443 --name=myprx --restart=always -v proxy-config:/data -e SECRET= 1ecefa19430cff07d62f69d5ad61b9dd telegrammessenger/proxy:latest
it was working very well, but suddenly it stop working, I even checked
netstat
result :tcp6 0 0 :::3032 :::* LISTEN 7090/docker-proxy
and docker :
82a4136a08c0 telegrammessenger/proxy:latest "/bin/sh -c '/bin/ba…" 10 minutes ago Up 10 minutes 0.0.0.0:3032->443/tcp myprx
and this is a log file of current container :
then I've done :
but nothing happened , any idea ?