The server I have in my local network cannot access api.telegram.org, the problem was solved instantly after I disabled IPv6 in router.
The proxy only works in IPv4 protocol, but the server prefer to use IPv6 so the requests were blocked by the GFW.
- Ubuntu 18.04 Server
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
- Modify the grub file located in /etc/default
# change GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX to GRUB_CMDLINE_LINUX_DEFAULT="ipv6.disable=1" GRUB_CMDLINE_LINUX="ipv6.disable=1"
- update grub
sudo update-grub #reboot to take affect sudo reboot