Webhook tunneling: How can I use a hosted server as a callback URL, which relays to a self-hosted n8n instance?

I want a php or perl script to reside on a hosted server, and that script will provide the callback URL for an interaction between Todoist’s webhook HTTP Post requests and n8n’s webhook node. The server on my lan running n8n will somehow run a client that maintains a connection to the aforementioned script. The client will enable data to flow between Todoist > (http post) > hosted server PHP script > local client (via http) > n8n webhook node (on lan).

Essentially, I need a tunnel with a php/perl script as the server. Does such a thing exist?

Why all the fuss? I don’t want to expose any local services to the internet right now. Most people just use localtunnel, ngrok to resolve this issue. However, they don’t provide persistent URLs (for free). I may purchase an inexpensive vps if I’m not able to use my existing hosted server to resolve the issue. Though, I’m trying to exhaust any other possibilities first.

I’ve been searching for solutions without much luck. My search terms have been:

  • php tunnel
  • php http tunnel
  • php webhook tunnel
  • php proxy webhook

One lead that didn’t pan out seemed to be the Kali HTTPTunnel package. The website states:

Two different servers are available:
The hosted server, which is basically a PHP script that must be put on a PHP enabled web server. Putting the PHP script on a webserver enables the webserver to act as your HTTP tunnel server.

After investigating, however, there is no such PHP script.

Anyone have any leads, search term tips, or software recommendations they can share?

Hey @San

This question is not directly related to n8n. But I can give you some idea and suggestion.

Since you don’t want to use ngrok. You can try DuckDNS and setup Port Forwarding on your router. Again there is a big security issue on this.

Alternatively you can try Hetzner Cloud to host your services. It won’t cost you much. (Recommended)

I may have missed something but do you really need a tunnel? Depending on how often you need to get n8n involved you could cache the requests on your server then use n8n on a schedule to pull anything new using the HTTP Request node.

For anything else maybe look into setting up an SSH tunnel between your n8n machine and your server that should get you around any issues or you could look into vpn software and create your local link that way.