Skip to main content

Language Configuration

Some language-specific environment configuration may be necessary but you should not need to modify your application code to use proxymock.

Configuring the Proxy

As the name implies, proxymock is a proxy which works by routing traffic from your application through proxymock before it goes to the final destination.

warning

99% of the time proxy configuration does not require a code change, but some HTTP client libraries have their own proxy configuration that may override or ignore environment variables. Check the documentation for your specific library.

Record inbound traffic by setting the --app-port flag and making requests to port 4143 instead of your application's port.

Go respects proxy environment variables.

export HTTP_PROXY=http://localhost:4140
export HTTPS_PROXY=http://localhost:4140
export NO_PROXY=localhost,127.0.0.1

Use the SOCKS proxy to capture database traffic:

export ALL_PROXY=socks5://localhost:4140

Decrypting TLS

proxymock attempts to automatically configure TLS on the desktop so manual configuration is only necessary in special environments like CI/CD or when TLS decryption does not work out of the box.

Commands and flags should be run in the environment where your application is running.

export SSL_CERT_FILE="${HOME}/.speedscale/certs/tls.crt"

Go applications using OpenSSL will respect the SSL_CERT_FILE environment variable to locate trusted root certificates. This environment variable will be automatically populated by the Speedscale operator.