mirror of
https://github.com/alexbers/mtprotoproxy.git
synced 2026-03-14 07:13:09 +00:00
Compare commits
193 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
446682521b | ||
|
|
b26873176a | ||
|
|
6e8e8b63b2 | ||
|
|
3b4f239cc1 | ||
|
|
0283d6264a | ||
|
|
15a8f607ca | ||
|
|
6076db9f8c | ||
|
|
6560a6c1d2 | ||
|
|
24479e68ab | ||
|
|
6ecf0ec9ac | ||
|
|
18a80e52cd | ||
|
|
ea3b8a44c3 | ||
|
|
37d570f8dc | ||
|
|
8f48e9ef65 | ||
|
|
76bc2253eb | ||
|
|
07bd9b795a | ||
|
|
1cad031947 | ||
|
|
923dac842b | ||
|
|
1a63fdae11 | ||
|
|
c7b6dcf3c2 | ||
|
|
a95b1ec3c1 | ||
|
|
49bc5d1f3b | ||
|
|
c2414c3487 | ||
|
|
8b26cc843d | ||
|
|
639dea5e8d | ||
|
|
c48cacce83 | ||
|
|
2bb0ef0b1f | ||
|
|
f5ee5db86f | ||
|
|
9c50cab94e | ||
|
|
199eaeb7c4 | ||
|
|
66ac871a74 | ||
|
|
c5344df0eb | ||
|
|
93ad268d48 | ||
|
|
1c29465b6e | ||
|
|
d41b4abf35 | ||
|
|
7f19b3f78d | ||
|
|
0549fd7200 | ||
|
|
fd75ca3cf9 | ||
|
|
522b0cfe75 | ||
|
|
4a4d449a34 | ||
|
|
8c15fc8fe0 | ||
|
|
e436792992 | ||
|
|
07759f67cb | ||
|
|
f525cc9611 | ||
|
|
c010543889 | ||
|
|
0a41479054 | ||
|
|
5f206361f2 | ||
|
|
6980bfd3be | ||
|
|
027ee2713b | ||
|
|
3c4c92cdb2 | ||
|
|
3ef826cd6b | ||
|
|
9ec1e543bd | ||
|
|
fae04ed3c7 | ||
|
|
25685f370c | ||
|
|
1feb8e5fc7 | ||
|
|
5e488203a2 | ||
|
|
94fd98a1fb | ||
|
|
4c5b0803fa | ||
|
|
8fa8aabc8e | ||
|
|
f2fbaa923b | ||
|
|
79eaabdd23 | ||
|
|
23c7b0d53b | ||
|
|
516600a32d | ||
|
|
5fcd1c0158 | ||
|
|
781549f37f | ||
|
|
dc1223fd90 | ||
|
|
0d52ae0bc7 | ||
|
|
2b1469985d | ||
|
|
4784491800 | ||
|
|
7a2c6b9825 | ||
|
|
37307a98fb | ||
|
|
02b39168c3 | ||
|
|
163e7b7cce | ||
|
|
1ed13d9efa | ||
|
|
51c8d68271 | ||
|
|
50cd74051f | ||
|
|
1d826866d1 | ||
|
|
ff6b826e13 | ||
|
|
3315ac1df6 | ||
|
|
4184875405 | ||
|
|
d34a15bca3 | ||
|
|
56bfab51d5 | ||
|
|
4f8b1b16db | ||
|
|
27f5d249a7 | ||
|
|
c51f6f85b8 | ||
|
|
44a52bf958 | ||
|
|
8520a26837 | ||
|
|
068996ab36 | ||
|
|
4faa96732f | ||
|
|
bee0b3be6b | ||
|
|
09fec8ca99 | ||
|
|
25d76bee09 | ||
|
|
a680b3e854 | ||
|
|
3fe87954a2 | ||
|
|
3fb3da139f | ||
|
|
014e450e62 | ||
|
|
04491f8a6a | ||
|
|
e081d6b727 | ||
|
|
ea28a7055a | ||
|
|
45cb849ca9 | ||
|
|
e66818326e | ||
|
|
4a1bf1ec6a | ||
|
|
854aaa1f24 | ||
|
|
5b0ad45cb9 | ||
|
|
26e00a7409 | ||
|
|
ac6d20a897 | ||
|
|
06ed40c815 | ||
|
|
1938c7d3bb | ||
|
|
01fd1a34c2 | ||
|
|
1a0977b10e | ||
|
|
9dc8521c18 | ||
|
|
4169e6acab | ||
|
|
121a8974de | ||
|
|
fdf5efe3d2 | ||
|
|
015d0a2012 | ||
|
|
dcad0bd51b | ||
|
|
da9e51ed03 | ||
|
|
59306e6e67 | ||
|
|
7502d1dc31 | ||
|
|
9df42cda79 | ||
|
|
a65f7a8e17 | ||
|
|
8a4bc77125 | ||
|
|
294cb65738 | ||
|
|
559c577df1 | ||
|
|
ccc8c3fb14 | ||
|
|
e061cd81c4 | ||
|
|
7527d402d6 | ||
|
|
f51a4bfe34 | ||
|
|
d9fa5b222a | ||
|
|
91ec36653e | ||
|
|
e43ae99911 | ||
|
|
ab52521a25 | ||
|
|
53184470e9 | ||
|
|
48330f1e8a | ||
|
|
4e2cb87685 | ||
|
|
a030ae2978 | ||
|
|
3d8961316e | ||
|
|
d7c163c0dc | ||
|
|
80062c95bc | ||
|
|
c1fdc4c0a3 | ||
|
|
f5d41e9aa7 | ||
|
|
4e754a75bd | ||
|
|
1a934f992d | ||
|
|
c543bc1c3d | ||
|
|
96ba65aba0 | ||
|
|
985e3eb546 | ||
|
|
129f5cc981 | ||
|
|
6fb022284e | ||
|
|
4691917c34 | ||
|
|
7d11ff07bd | ||
|
|
1c875e3d31 | ||
|
|
a2890cf213 | ||
|
|
026849cb54 | ||
|
|
4f1fea79eb | ||
|
|
50df84bc80 | ||
|
|
6823117c63 | ||
|
|
d21eab60c2 | ||
|
|
312539c3b8 | ||
|
|
a9e12bb1bb | ||
|
|
6c5155ce07 | ||
|
|
422c409480 | ||
|
|
cdd4fef49e | ||
|
|
9da90d25d3 | ||
|
|
eba7f9be69 | ||
|
|
af8c102449 | ||
|
|
a01896522d | ||
|
|
6f70ff3003 | ||
|
|
d48c177e36 | ||
|
|
f55ae68092 | ||
|
|
4cae6290b9 | ||
|
|
830d55fe77 | ||
|
|
66d9c03ff9 | ||
|
|
73592c4f72 | ||
|
|
b0cb48f684 | ||
|
|
cb10355681 | ||
|
|
bd8e0f935d | ||
|
|
e2435461ca | ||
|
|
47218748aa | ||
|
|
b082d06f9b | ||
|
|
5187725088 | ||
|
|
dd1d0a6262 | ||
|
|
d5daf8bbdf | ||
|
|
780dbc5866 | ||
|
|
298614b1f6 | ||
|
|
f5c30c6115 | ||
|
|
e4473d6374 | ||
|
|
c2278501bf | ||
|
|
534b26cd04 | ||
|
|
c1bef68602 | ||
|
|
8e79dacd26 | ||
|
|
520a26aa89 | ||
|
|
647b6f6edd | ||
|
|
c2ad0de665 |
17
Dockerfile
17
Dockerfile
@@ -1,15 +1,14 @@
|
||||
FROM alpine:3.6
|
||||
FROM ubuntu:22.04
|
||||
|
||||
RUN adduser tgproxy -u 10000 -D
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y python3 python3-uvloop python3-cryptography python3-socks libcap2-bin ca-certificates && rm -rf /var/lib/apt/lists/*
|
||||
RUN setcap cap_net_bind_service=+ep /usr/bin/python3.10
|
||||
|
||||
RUN apk add --no-cache python3 py3-cryptography ca-certificates libcap
|
||||
|
||||
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
|
||||
RUN useradd tgproxy -u 10000
|
||||
|
||||
USER tgproxy
|
||||
|
||||
WORKDIR /home/tgproxy/
|
||||
CMD ["./mtprotoproxy.py"]
|
||||
|
||||
COPY --chown=tgproxy mtprotoproxy.py config.py /home/tgproxy/
|
||||
|
||||
CMD ["python3", "mtprotoproxy.py"]
|
||||
|
||||
19
README.md
19
README.md
@@ -1,27 +1,34 @@
|
||||
# Async MTProto Proxy #
|
||||
|
||||
Fast and simple to setup mtproto proxy.
|
||||
Fast and simple to setup MTProto proxy written in Python.
|
||||
|
||||
## 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 --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`
|
||||
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`
|
||||
|
||||

|
||||
|
||||
## Channel Advertising ##
|
||||
|
||||
To advertise a channel get a tag from **@MTProxybot** and write it to *config.py*.
|
||||
To advertise a channel get a tag from **@MTProxybot** and put it to *config.py*.
|
||||
|
||||
## Performance ##
|
||||
|
||||
The proxy performance should be enough to comfortably serve about 4 000 simultaneous users on
|
||||
the VDS instance with 1 CPU core and 1024MB RAM.
|
||||
|
||||
## More Instructions ##
|
||||
|
||||
- [Running without Docker](https://github.com/alexbers/mtprotoproxy/wiki/Running-Without-Docker)
|
||||
- [Optimization and fine tuning](https://github.com/alexbers/mtprotoproxy/wiki/Optimization-and-Fine-Tuning)
|
||||
|
||||
## Advanced Usage ##
|
||||
|
||||
The proxy can be launched:
|
||||
- with a custom config: `python3 mtprotoproxy.py [configfile]`
|
||||
- several times, clients will be automaticaly balanced between instances
|
||||
- using *PyPy* interprteter
|
||||
- with runtime statistics exported for [Prometheus](https://prometheus.io/): using [prometheus](https://github.com/alexbers/mtprotoproxy/tree/prometheus) branch
|
||||
- with uvloop module to get an extra speed boost
|
||||
- with runtime statistics exported to [Prometheus](https://prometheus.io/)
|
||||
|
||||
23
config.py
23
config.py
@@ -1,10 +1,27 @@
|
||||
PORT = 3256
|
||||
PORT = 443
|
||||
|
||||
# name -> secret (32 hex chars)
|
||||
USERS = {
|
||||
"tg": "00000000000000000000000000000000",
|
||||
"tg2": "0123456789abcdef0123456789abcdef"
|
||||
"tg": "00000000000000000000000000000001",
|
||||
# "tg2": "0123456789abcdef0123456789abcdef",
|
||||
}
|
||||
|
||||
MODES = {
|
||||
# Classic mode, easy to detect
|
||||
"classic": False,
|
||||
|
||||
# Makes the proxy harder to detect
|
||||
# Can be incompatible with very old clients
|
||||
"secure": False,
|
||||
|
||||
# Makes the proxy even more hard to detect
|
||||
# Can be incompatible with old clients
|
||||
"tls": True
|
||||
}
|
||||
|
||||
# The domain for TLS mode, 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,4 +4,13 @@ services:
|
||||
build: .
|
||||
restart: unless-stopped
|
||||
network_mode: "host"
|
||||
volumes:
|
||||
- ./config.py:/home/tgproxy/config.py
|
||||
- ./mtprotoproxy.py:/home/tgproxy/mtprotoproxy.py
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
logging:
|
||||
driver: "json-file"
|
||||
options:
|
||||
max-file: "10"
|
||||
max-size: "10m"
|
||||
# mem_limit: 1024m
|
||||
|
||||
1969
mtprotoproxy.py
1969
mtprotoproxy.py
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user