continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
18.66k stars 1.56k forks source link

Not able to use with proxy #1147

Open HatefulRock opened 6 months ago

HatefulRock commented 6 months ago

Before submitting your bug report

Relevant environment info

- OS: Windows 10
- Continue: v0.8.24
- IDE: VSCode

Description

Unable to use continue on vscode with proxy

To reproduce

No response

Log output

request to https://proxy-server-green-l6vsfbzhba-uw.a.run.app/stream_chat failed, reason: self signed certificate in certificate chain

POST https://us.i.posthog.com/e/?retry_count=1&ip=1&_=1713432561822&ver=1.116.6&compression=base64 net::ERR_CERT_AUTHORITY_INVALID
[Extension Host] FetchError: request to https://proxy-server-green-l6vsfbzhba-uw.a.run.app/stream_chat failed, reason: self signed certificate in certificate chain
    at ClientRequest.<anonymous> (c:\Users\a0e72199\.vscode\extensions\continue.continue-0.8.24-win32-x64\out\extension.js:25975:14)
    at ClientRequest.emit (node:events:529:35)
    at ClientRequest.emit (node:domain:489:12)
    at TLSSocket.socketErrorListener (node:_http_client:501:9)
    at TLSSocket.emit (node:events:517:28)
    at TLSSocket.emit (node:domain:489:12)
    at emitErrorNT (node:internal/streams/destroy:151:8)
    at emitErrorCloseNT (node:internal/streams/destroy:116:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
sestinj commented 6 months ago

@HatefulRock Would you be able to share a bit more info about what your proxy setup looks like? Most importantly, there is the HTTP: Proxy field in VS Code settings, and the HTTP: Proxy Support field.

If you already have VS Code set up to use a proxy, then the Proxy Support field can be set to "override" in order to handle all outgoing traffic from extensions automatically and send it through your proxy.

Otherwise, Continue also has a proxy option in config.json which can be set for each model with "requestOptions.proxy"

ilyanoskov commented 6 months ago

@sestinj is it also possible to configure a no_proxy variable?

sestinj commented 6 months ago

@ilyanoskov We don't have this today, but to make sure I understand what you mean:

You would set requestOptions.proxy to the proxy that you want most requests to go through, and also requestOptions.noProxy with a list of host names that you don't want the proxy to be used for?

nmcostello commented 4 months ago

@sestinj this is a feature that we would also like to see implemented. Your understanding is correct.

sestinj commented 4 months ago

@nmcostello Here's a first pass at the feature: https://github.com/continuedev/continue/commit/e7f1f43fddc81034a046c0bbde5d963b53282e17

I'll release it later today in pre-release, but let me know if there's anything else that you would need

nmcostello commented 4 months ago

Awesome! I'll check it out in the pre-release. This should be what's needed.

sooit commented 4 months ago

I have the same request. I set the config.json like this. But it doesn't work at version of 0.8.40. Looking forward to your new release. { "model": "gpt-4o", "title": "GPT-4o", "systemMessage": "You are an expert software developer. You give helpful and concise responses.", "apiKey": "my-api-key", "completionOptions": {}, "provider": "openai", "requestOptions":{ "proxy": "socks5h://127.0.0.1:7890" } }

sestinj commented 4 months ago

Just pushed 0.9.154 so it should be on the store in a matter of 20 minutes