Sometimes your application can reach an external service from one server, but not from another.
I ran into this problem while working on one of my projects. I needed my server in Iran to communicate with Telegram, but the connection wasn't reliable from inside Iran.
Instead of moving the whole application, I built a small intermediate service:
Signed Webhook Receiver
It is a lightweight FastAPI service that receives requests signed with an RSA private key and verifies them using the corresponding public key before processing them.
Your Server
|
| RSA Signed Request
v
Webhook Receiver
|
| HTTP Request
v
External Service
The receiver can be useful for:
- Secure server-to-server communication
- Webhooks and internal APIs
- Acting as a controlled proxy/gateway
- Connecting servers across different network environments
- Payment integrations where a provider requires requests from an Iranian IP
For example, if your main application is hosted outside Iran but a payment gateway only accepts requests from Iranian IP addresses, an Iranian server can act as the intermediate gateway:
Foreign Server
|
| Signed Request
v
Iranian Gateway Server
|
v
Payment Gateway
The important part is that this isn't an open proxy. Requests can be authenticated and the gateway can be restricted to specific operations and destinations.
The project is built with Python, FastAPI, Cryptography, Docker, and Traefik and is open source.
I also wrote more technical notes and development articles on my website:
Building a Secure Webhook Receiver for Server-to-Server Communication | CyberHuginn
Top comments (0)