Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

docker-compose.yml 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. # SNI-routing deployment: HAProxy (443) -> mtg + real web backend
  2. #
  3. # This setup puts an SNI-aware TCP router in front of mtg so that:
  4. # - Telegram clients (FakeTLS with the correct SNI) are routed to mtg
  5. # - All other TLS traffic (including DPI probes) reaches the real web
  6. # server, which responds with a genuine certificate
  7. #
  8. # The result: active probes see a real website; passive DPI sees matching
  9. # SNI/IP because the domain resolves to this server's IP.
  10. #
  11. # Quick start:
  12. # 1. Set YOUR_DOMAIN below (and in mtg-config.toml)
  13. # 2. docker compose up -d
  14. # 3. mtg generate-secret YOUR_DOMAIN -> put it in mtg-config.toml
  15. # 4. docker compose restart mtg
  16. #
  17. # See BEST_PRACTICES.md and the project wiki for background.
  18. services:
  19. haproxy:
  20. image: haproxy:lts-alpine
  21. ports:
  22. - "443:443"
  23. - "80:80"
  24. volumes:
  25. - ./haproxy.cfg:/usr/local/etc/haproxy/haproxy.cfg:ro,Z
  26. depends_on:
  27. - mtg
  28. - web
  29. restart: unless-stopped
  30. sysctls:
  31. - net.ipv4.ip_unprivileged_port_start=80
  32. mtg:
  33. image: nineseconds/mtg:2
  34. volumes:
  35. - ./mtg-config.toml:/config/config.toml:ro,Z
  36. expose:
  37. - "3128"
  38. restart: unless-stopped
  39. extra_hosts:
  40. - "host.containers.internal:host-gateway"
  41. web:
  42. image: caddy:alpine
  43. volumes:
  44. - ./Caddyfile:/etc/caddy/Caddyfile:ro,Z
  45. - caddy_data:/data
  46. - ./www:/srv:ro,Z
  47. expose:
  48. - "80"
  49. - "8443"
  50. environment:
  51. DOMAIN: ${DOMAIN:-example.com}
  52. restart: unless-stopped
  53. volumes:
  54. caddy_data: