mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-17 00:09:44 +00:00
Compare commits
1 Commits
v1.0.8
...
prometheus
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7fcc854e80 |
10
Dockerfile
10
Dockerfile
@@ -1,15 +1,15 @@
|
||||
FROM alpine:3.10
|
||||
FROM alpine:3.6
|
||||
|
||||
RUN adduser tgproxy -u 10000 -D
|
||||
|
||||
RUN apk add --no-cache python3 py3-cryptography ca-certificates libcap
|
||||
|
||||
RUN chown -R tgproxy:tgproxy /home/tgproxy
|
||||
RUN setcap cap_net_bind_service=+ep /usr/bin/python3.7
|
||||
|
||||
COPY mtprotoproxy.py config.py /home/tgproxy/
|
||||
|
||||
RUN chown -R tgproxy:tgproxy /home/tgproxy
|
||||
RUN setcap cap_net_bind_service=+ep /usr/bin/python3.6
|
||||
|
||||
USER tgproxy
|
||||
|
||||
WORKDIR /home/tgproxy/
|
||||
CMD ["python3", "mtprotoproxy.py"]
|
||||
CMD ["./mtprotoproxy.py"]
|
||||
|
||||
13
README.md
13
README.md
@@ -1,19 +1,17 @@
|
||||
# Async MTProto Proxy #
|
||||
|
||||
Fast and simple to setup MTProto proxy written in Python.
|
||||
Fast and simple to setup mtproto proxy.
|
||||
|
||||
## Starting Up ##
|
||||
|
||||
1. `git clone -b stable https://github.com/alexbers/mtprotoproxy.git; cd mtprotoproxy`
|
||||
2. *(optional, recommended)* edit *config.py*, set **PORT**, **USERS** and **AD_TAG**
|
||||
3. `docker-compose up -d` (or just `python3 mtprotoproxy.py` if you don't like Docker)
|
||||
4. *(optional, get a link to share the proxy)* `docker-compose logs`
|
||||
|
||||

|
||||
3. `docker-compose up --build -d` (or just `python3 mtprotoproxy.py` if you don't like docker)
|
||||
4. *(optional, shows telegram link to set the proxy)* `docker-compose logs`
|
||||
|
||||
## Channel Advertising ##
|
||||
|
||||
To advertise a channel get a tag from **@MTProxybot** and put it to *config.py*.
|
||||
To advertise a channel get a tag from **@MTProxybot** and write it to *config.py*.
|
||||
|
||||
## Performance ##
|
||||
|
||||
@@ -25,5 +23,4 @@ the VDS instance with 1 CPU core and 1024MB RAM.
|
||||
The proxy can be launched:
|
||||
- with a custom config: `python3 mtprotoproxy.py [configfile]`
|
||||
- several times, clients will be automaticaly balanced between instances
|
||||
- with uvloop module to get an extra speed boost
|
||||
- with runtime statistics exported to [Prometheus](https://prometheus.io/)
|
||||
- using *PyPy* interprteter
|
||||
|
||||
18
config.py
18
config.py
@@ -1,22 +1,10 @@
|
||||
PORT = 443
|
||||
PORT = 3256
|
||||
|
||||
# name -> secret (32 hex chars)
|
||||
USERS = {
|
||||
"tg": "00000000000000000000000000000001",
|
||||
# "tg2": "0123456789abcdef0123456789abcdef",
|
||||
"tg": "00000000000000000000000000000000",
|
||||
"tg2": "0123456789abcdef0123456789abcdef"
|
||||
}
|
||||
|
||||
# Makes the proxy harder to detect
|
||||
# Can be incompatible with very old clients
|
||||
SECURE_ONLY = True
|
||||
|
||||
# Makes the proxy even more hard to detect
|
||||
# Compatible only with the recent clients
|
||||
TLS_ONLY = True
|
||||
|
||||
# The domain for TLS, bad clients are proxied there
|
||||
# Use random existing domain, proxy checks it on start
|
||||
# TLS_DOMAIN = "www.google.com"
|
||||
|
||||
# Tag for advertising, obtainable from @MTProxybot
|
||||
# AD_TAG = "3c09c680b76ee91a4c25ad51f742267d"
|
||||
|
||||
@@ -4,7 +4,4 @@ services:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
network_mode: "host"
|
||||
volumes:
|
||||
- ./config.py:/home/tgproxy/config.py
|
||||
- ./mtprotoproxy.py:/home/tgproxy/mtprotoproxy.py
|
||||
# mem_limit: 1024m
|
||||
|
||||
1859
mtprotoproxy.py
1859
mtprotoproxy.py
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user