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.
Proxy Setup for VS Code
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
- 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.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:
{
"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:
{
"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:
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
- Download the self-signed certificate.
- Open Keychain Access and 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 Certificates by typing it in the Windows search bar.
- Import the certificate into the Trusted Root Certification Authorities store.
- Confirm that the certificate is listed and trusted.
Please confirm with your IT Administrator to ensure you trust the right certificate.
Testing Self-Signed Certificates
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:
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.