Community discussions

 
uhm
just joined
Topic Author
Posts: 3
Joined: Sun Jan 25, 2015 5:59 pm

Fetch via proxy

Wed Jan 02, 2019 5:02 pm

Hi! I'm trying to teach my Mikrotik to send Telegram alerts, but the usual way to do that is to send the GET request to api.telegram.org via /tool fetch. However, my ISP blocks telegram.org, so direct connection is not allowed. I also have an access to proxy server, which can connect to telegram.org. Is there a way to send the GET request via this proxy? Thanks!
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1776
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: Fetch via proxy

Wed Jan 02, 2019 5:06 pm

Hey

Policy based routing: "for specific ip go that route". Define a routing rule in for the ip in question and make sure you have additional routing table for proxy.
under /ip route & /ip route rule
 
pe1chl
Forum Guru
Forum Guru
Posts: 5816
Joined: Mon Jun 08, 2015 12:09 pm

Re: Fetch via proxy

Wed Jan 02, 2019 5:42 pm

A proxy request does not have the same format as a direct request, so that is not going to work!
You could setup a tunnel to another place where this site is not blocked, and route the traffic over that runnel with srcnat/dstnat at the other side of the tunnel.
That works, but it requires that you have such a site. You could e.g. host a CHR somewhere on a virtual server provider.
Doing so has other advantages: you can setup a tunnel from/to each router that you manage, and from your own system, and use this construct for secure remote management.
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1776
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: Fetch via proxy

Wed Jan 02, 2019 5:52 pm

No detail about the proxy so hard to tell, but transparent proxy should just work if traffic is directed it's way.
 
uhm
just joined
Topic Author
Posts: 3
Joined: Sun Jan 25, 2015 5:59 pm

Re: Fetch via proxy

Wed Jan 02, 2019 7:34 pm

I have a 3proxy on a VPS, and I can configure it in any way possible (theoretically :) ). Currently it has authorization by username/password and is set up on a non-standard port.

I've tried the first approach with routes, but I can't figure out the part where I have to configure a gateway, the example in the wiki is for VPN connection, not proxy server. I don't think I can make a PPTP connection to a proxy server, can I?

I've also read about CHR - I'm pretty much a beginner in network administration, I think it would be too hard for me to set one up.

If there's no obvious way to send part of the traffic via external proxy - would setting up a VPN server on the remote VDS and then following an example from Policy Based Routing wiki solve the problem?

Thanks!
 
User avatar
sebastia
Forum Guru
Forum Guru
Posts: 1776
Joined: Tue Oct 12, 2010 3:23 am
Location: Antwerp, BE

Re: Fetch via proxy

Wed Jan 02, 2019 7:49 pm

If the proxy can be setup as transparent proxy (can be done www.google.be/search?q=3proxy+transparent+proxy), then a tunnel/vpn to remote vps should do the trick.
You'll need to disable to authentication, as that requires browser support, and only allow traffic from vpn, so it can't be abused remotely. Then via routing rule direct traffic over vpn and send that to the proxy server using dst-nat.
If the proxy runs on ip linked to vpn, the routing rule + table won't be needed, as router will send it automatically over vpn.

Who is online

Users browsing this forum: No registered users and 8 guests