Java
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.
You can use Fixie with any HTTP library. Popular options include Apache HttpClient and OkHttp.
Using HttpClient
Using OkHttp
Using java.net.ProxySelector
Java supports a system property socksProxyHost, which can be used to route every outbound request through Fixie Socks. Additionally, Java 7 introduced ProxySelector, which can be used to conditionally proxy requests depending on the hostname.
A simple example that proxies all outbound requests through Fixie Socks:
Related static IP guides
Platform-specific guides for giving your Java app a static outbound IP:
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.