Go
NOTE: The documentation below assumes either
FIXIE_URLorFIXIE_SOCKS_HOSTEnvironment Variables are set. If your application is deployed on either Heroku or Vercel via our official integration, these environments will be set for you. Otherwise, see the setup guide for the platform you are using in the Platforms section below for how to set them manually.
Using http.Client
To use Fixie for specific http requests, you can create a custom http.Client:
If you intend to use Fixie for all outbound requests, an alternative is to use the HTTP_PROXY and HTTPS_PROXY environment variables. Go honors these environment variables by default. You can set HTTP_PROXY and HTTPS_PROXY in your application, typically in main.go:
Using net/proxy package
Golang's net/proxy package provides a Socks5 proxy dialer that can be used with Fixie Socks. This dialer can be used for any TCP connection. The example below uses this to make an HTTP request:
Related static IP guides
Platform-specific guides for giving your Go app a static outbound IP:
- Go on Heroku → API
- Go on Vercel → API
- Go on Render → API
- Go on Fly.io → API
- Go on AWS Lambda → API
- Go on Heroku → Postgres
See the full list of static IP guides for every supported language, platform, and destination.
Is this guide useful?
Having issues? Please reach out to our team here.