MTProxy
MTProxy copied to clipboard
Need instructions on opeining stats port
As last commit by @vvaltman was "mtproto: by default do not open stats port" it is now unclear how to set up it to show stats.
Add --http-stats
argument to the command line
Add
--http-stats
argument to the command line
Please help. Can I add this argument to docker? It says: unknown flag: --http-stats
Thank you!
docker run -d -p443:443 --name=mtproto-proxy --http-stats --restart=always -v proxy-config:/data -e TAG=(mytag) -e SECRET=(mykey) telegrammessenger/proxy:latest
I think you need to edit your docker's run.sh, check https://github.com/TelegramMessenger/MTProxy/issues/251
was able to start wiht it, but not clear is this working at all --2019-02-02 16:36:21-- (try: 3) http://127.0.0.1:8888/stats Connecting to 127.0.0.1:8888... connected. HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers. Where those stats are stored so i could check if they are collected?
wget localhost:8888/stats
nano stats
Worked for me
Can someone please explain how to edit this file? Or maybe there is updated docker image?
It was my 2nd day using Linux, so my solution may be bad.
I used "find" to locate run.sh in Docker subdirectory. And added - - http-stats to the last string, using receipt in parallel thread.
Okay, I figured it out:
docker ps
- get your container ID
sudo docker exec -it CONTAINER_ID /bin/bash
apt-get update
apt-get install nano
nano run.sh
After that add --http-stats to exec command.
exit
and docker restart CONTAINER_ID
Definitely not a best solution, but it works.
docker exec mtproto-proxy curl http://0.0.0.0:2398/stats
It could be overriden with custom docker-compose.yml file.
I ran into the problem that the update mirrors are old, and you can not install "nano". After connect to your Docker container sudo docker exec -it CONTAINER_ID /bin/bash
you need to update the mirrors :
printf "deb http://deb.debian.org/debian/ bullseye main\ndeb-src http://deb.debian.org/debian/ bullseye main" > /etc/apt/sources.list.d/backports.list
After that it is possible to install "nano".