Run Cody via proxies

This documentation helps you set up HTTP, HTTPS, and SOCKS proxies in VS Code and JetBrains IDEs. It also includes instructions for handling self-signed certificates on macOS and Windows.

You may be unable to authenticate with Cody or see a network reachability issue if you attempt to use Cody before configuring your proxy settings.

Accessing the Proxy Settings

  1. Open VS Code.
  2. Navigate to the settings window of VS Code
  3. In the search bar at the top of the Settings pane, type proxy
  4. Click on Edit in settings.json to open the settings.json file

Modifying settings.json for Proxy Configuration

Add the following configuration fields in the settings.json file to set up your proxy:

JSON
{ "http.proxy": "http://proxy_ip:port", // Replace with your proxy IP and port "http.proxySupport": "on", "http.proxyStrictSSL": true, "http.systemCertificates": true, "http.experimental.systemCertificatesV2": true }

Self-Signed Certificates in VS Code

If your proxy uses self-signed certificates, ensure the following settings are enabled:

JSON
{ "http.systemCertificates": true, "http.experimental.systemCertificatesV2": true }

Restart VS Code

After modifying the settings.json file, close and restart VS Code to apply the new proxy settings.

Supported Proxy Types

VS Code supports HTTP, HTTPS, and SOCKS proxies. The http.proxy setting in settings.json will accommodate all three types based on the provided proxy URL.

Troubleshooting the Proxy Setup

Basic Connectivity Test

To verify that your proxy setup works, use the following curl command in your terminal, replacing proxy_ip and instance_ip with your actual proxy and instance IP addresses:

BASH
curl -x http://proxy_ip:port http://instance_ip

This command should return a response from the instance, confirming that the proxy is correctly routing your requests.

Adding Self-Signed Certificates

For macOS

  1. Download the self-signed certificate.
  2. Open Keychain Access and import the certificate.
  3. Ensure the certificate is added by searching for the proxy IP.
  4. Set the certificate to Always Trust.

For Windows

  1. Download the self-signed certificate.
  2. Open Manage User Certificates by typing it in the Windows search bar.
  3. Import the certificate into the Trusted Root Certification Authorities store.
  4. Confirm that the certificate is listed and trusted.
Please confirm with your IT Administrator to ensure you trust the right certificate.

When adding self-signed certificates, try making a curl request routed through the HTTPS proxy to check if the computer uses the self-signed certificate. Your request will look something like:

BASH
curl -x https://proxy_ip https://destination_ip

Additional Support

Please get in touch with the Cody support team if you need further assistance with proxy configurations, especially for special enterprise setups. They can provide guidance tailored to your specific network environment.

Previous
Context Filters