How to set up HTTP Custom with your CloudFront CDN
HTTP Custom is an Android app for creating encrypted tunnels from your phone. This guide takes you from zero to a working connection through your CloudFront CDN, and explains how to check that everything works and what to do if something fails.
What you need before you start
- An Android phone with the HTTP Custom app installed from Google Play.
- An active CDN service. If you don't have one yet, follow the guide on getting your CloudFront CDN.
- The SSH username and password of your own server (the one you set as the CDN origin).
Step 1: copy your CDN details
Go to the site, open the CDN section and find your service under My CDN services. There you have the CDN host, port 80 and the CloudFront payload, each with a copy button.
Step 2: set up the app
- Open HTTP Custom and create a new configuration.
- In the SSH details, enter the CDN host (it ends in
cloudfront.net) and port 80 as the server, followed by your server's username and password:host:80@username:password. - Turn on the custom payload option and paste your service's CloudFront payload.
- Save the configuration.
Step 3: connect and check
Tap the start button. The app log will show the WebSocket's HTTP/1.1 101 response followed by the SSH authentication. To confirm, open a website that shows your public IP in the browser: it should match your server's, not your carrier's.
Troubleshooting
Error 403 or 404 in the log
The payload doesn't match your service: check that the path and host are exactly the ones on your card. Copy the payload again with the button.
Error 502 or 504
CloudFront can't reach your server. Check that the origin is correct, that the server is on and that it accepts WebSocket on port 80. If you changed servers, update the origin with Change origin.
"Authentication failed"
Your server's SSH username or password is wrong. Check them, keeping upper and lower case exactly as they are.
It used to connect and stopped working
Check on the site whether your service is still Active. If it expired, renew it: you keep the same host, path and payload.
It disconnects every few minutes
This is usually Android's battery saver. Let the app run without battery restrictions.
Tip. NetMod and other apps that support SSH over WebSocket with a payload are set up the same way: CDN host, port 80 and the same payload.