Skip to content

How to connect TradingView webhooks to Binance API via AWS - fixed IP address only ipv4 (step‑by‑step, non‑developer)

-1

Hi everyone, I would like to connect TradingView webhooks to the Binance API using an AWS instance, but I’m not a developer.

Goal:

  • Receive TradingView webhook alerts
  • Forward them to Binance via API
  • Run everything on AWS with a fixed IP that I can whitelist on Binance

Constraints:

  • Binance requires IP restrictions → I need a fixed IP for the API key
  • TradingView webhooks only support IPv4 and ports 80 and 443
  • I looked at AWS Lightsail + Nginx as a reverse proxy, but the Nginx on AWS seems to only support IPv6
    I’m looking for a low‑cost solution and alternatives to Nginx on AWS that:
  • Support IPv4
  • Work on ports 80 and 443

Please provide a step‑by‑step setup guide with command line:

  • Which AWS service to choose (preferably Lightsail) and how to create/configure the instance
  • How to install and configure a reverse proxy (e.g., Lambda, Apache, Caddy, HAProxy, or other suggestion)
  • Exact commands to:
    • Install required packages
    • Edit config files
    • Enable IPv4 on ports 80 and 443
    • Set up SSL/HTTPS if needed (Let’s Encrypt, AWS Certificate Manager, etc.)
  • How to receive TradingView webhooks on that server (URL format, example config)
  • How to forward those requests to the Binance API securely

I haven’t found any clear guide for:
TradingView → reverse proxy → Lightsail → Binance (or other exchange).

Thank you very much for any detailed, step‑by‑step guidance! Best regards

asked 15 days ago78 views
2 Answers
1
Accepted Answer

I understand you want to connect TradingView webhooks to Binance API through AWS with a fixed IPv4 address. While I can provide some AWS-specific guidance, I should clarify that the sources available don't contain a complete step-by-step tutorial for your specific TradingView-to-Binance integration scenario.

However, I can address some of your AWS infrastructure concerns:

Regarding IPv4 Support on AWS: Your assumption about AWS services only supporting IPv6 is incorrect. AWS services, including those running on EC2 instances (which Lightsail is built on), fully support IPv4. When you launch an AWS Lightsail instance or EC2 instance, you can obtain a static IPv4 address that you can whitelist on Binance.

For Fixed IP Address: AWS offers Elastic IP addresses for EC2 instances, which provide static IPv4 addresses that persist even if you stop and restart your instance. For Lightsail, you can create a static IP and attach it to your instance through the Lightsail console.

General Architecture Approach:

  1. Launch an AWS Lightsail or EC2 instance with a public IPv4 address
  2. Attach/allocate a static IP address to ensure it doesn't change
  3. Configure your instance's security group to allow inbound traffic on ports 80 and 443
  4. Install your chosen web server or reverse proxy (Apache, Nginx, Caddy all support IPv4)
  5. Set up SSL certificates for HTTPS (Let's Encrypt works well for this)
  6. Deploy your webhook receiver application that processes TradingView alerts and forwards to Binance

Important Notes:

  • The specific commands for installing packages, configuring reverse proxies, and setting up the webhook-to-Binance forwarding logic would depend on your chosen technology stack and programming language
  • You'll need to develop or use existing software to handle the webhook reception and API forwarding logic
  • Security is critical when handling API keys - ensure proper encryption and secure storage

For the detailed step-by-step commands and configuration files specific to TradingView and Binance integration, you would need to consult TradingView's webhook documentation, Binance's API documentation, and potentially seek guidance from developer communities or hire a developer to set up the integration logic, as this goes beyond standard AWS infrastructure setup.

answered 15 days ago
EXPERT
reviewed 14 days ago
  • This is the information provided by amazon: Nginx blueprint by Amazon Lightsail The Nginx blueprint in Amazon Lightsail supports IPv6-only instances, allowing users to deploy pre-configured web servers with Nginx preinstalled. This blueprint is available in all AWS Regions where Lightsail is available, providing a convenient way to get started on the cloud. It is important to note that the Nginx blueprint does not support dual-stack networking, meaning it does not support public IPv4 traffic. It means that nginx won´t work with trading view ipv4 webhook, correct?

1

Hi,

I can answer some of the lightsail specific questions that you have below:

Lightsail supports both dual-stack and IPv6-only instances for Nginx by lightsail. The dual-stack instance will have an IPv4 address associated with the instance as well. Please find this doc with the information to setup Nginx: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-quick-start-guide-nginx.html

To answer the other question of having a fixed IP, you can do that as well by attaching a staticIP to your newly created instance. The doc above highlights how to do that. For more information on StaticIP, please refer: https://docs.aws.amazon.com/lightsail/latest/userguide/understanding-static-ip-addresses-in-amazon-lightsail.html

You can also follow the guide on how to setup Lets Encrypt for your instance: https://docs.aws.amazon.com/lightsail/latest/userguide/amazon-lightsail-using-lets-encrypt-certificates-with-nginx.html. Make sure to follow the right steps for Nginx by Lightsail.

AWS
answered 14 days ago
  • Hi, thank you for your reply. Can you please advice for this case which language is preferred for the web hook handler app: node.js or python? Thank you

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.