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.
Accessing the Proxy Settings
- Open VS Code.
- Navigate to the settings window of VS Code
- In the search bar at the top of the Settings pane, type
proxy - Click on
Edit in settings.jsonto open thesettings.jsonfile
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:
BASHcurl -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
- Download the self-signed certificate.
- Open
Keychain Accessand import the certificate. - Ensure the certificate is added by searching for the proxy IP.
- Set the certificate to
Always Trust.
For Windows
- Download the self-signed certificate.
- Open
Manage User Certificatesby typing it in the Windows search bar. - Import the certificate into the
Trusted Root Certification Authoritiesstore. - Confirm that the certificate is listed and trusted.
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:
BASHcurl -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.