I
I
Ivan2019-07-04 02:39:55
Messengers
Ivan, 2019-07-04 02:39:55

How to access api.telegram.org using the ip address of your vps?

You need to have access to api.telegram.org, I read about vpn and proxy but did not understand anything, you need to specify the port, login, etc.
I need to be able to access api.telegram.org by simply replacing it with my ip address with digitalocean.
I read the comment here in the question


It is not necessary to transfer bots, it was enough for me to just make a proxy. On a foreign VPS like this:
apt-get update && apt-get install -y nano nginx
nano /etc/nginx/sites-available/default # в location добавить "proxy_pass https://api.telegram.org/;"
service nginx reload

And instead of https://api.telegram.org , access the ip of this server.

but I didn’t understand how to implement it, the indicated commands didn’t work for me :(
Please, briefly or in detail, describe this mechanism.
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-07-04
@9StarRu

It's not entirely clear what you want to end up with? Raise VPN?
There is nothing complicated here. Most of the instructions are pretty simple.
Let's look at an example (if you have vps, vds abroad):
There is such a thing https://github.com/hwdsl2/setup-ipsec-vpn this is a wrapper over Libreswan
There is also the same wrapped in docker https:// github.com/hwdsl2/docker-ipsec-vpn-server
And I think this is what you need.
Install Docker CE
Run on the server:

docker run \
    --name ipsec-vpn-server \
    --env-file ./vpn.env \
    --restart=always \
    -p 500:500/udp \
    -p 4500:4500/udp \
    -d --privileged \
    hwdsl2/ipsec-vpn-server

For ./vpn.envpointing your way.
VPN_IPSEC_PSK=your_ipsec_pre_shared_key
VPN_USER=your_vpn_username
VPN_PASSWORD=your_vpn_password

After starting, check that the container has started docker logs ipsec-vpn-server
. Something similar to:
Connect to your new VPN with these details:

Server IP: your_vpn_server_ip
IPsec PSK: your_ipsec_pre_shared_key
Username: your_vpn_username
Password: your_vpn_passwor

It works fine for me on pure 9th Android One
and under Linux (did not try under Windows).
##########
I need to be able to access api.telegram.org by simply replacing it with my ip address with digitalocean.
I read the comment here in the question

On nginx, they proxy access to api.telegram.org.
Here you need to see how you tried (attach the nginx config to the question), in general, there is nothing complicated about this.
PS it is possible that you will need to open ports on VDS / VPS, then you will bother to do it yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question