Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy setting hangs chat indefinitely #309

Open
m8dotpie opened this issue May 8, 2024 · 4 comments
Open

Proxy setting hangs chat indefinitely #309

m8dotpie opened this issue May 8, 2024 · 4 comments
Labels
bug Something isn't working question Further information is requested

Comments

@m8dotpie
Copy link

m8dotpie commented May 8, 2024

I am using copilot through my VPS.

  • CopilotChat health is OK except tiktoken
  • CopilotChat works under machine wide VPN
  • copilot.vim works under the same proxy
  • CopilotChat hangs indefinitely after any query under proxy setting
  • Proxy is https://ip:port
  • Copilot chat starts to work through the proxy if I omit the protocol

Am I using the parameter in the wrong way or it is really bugged if the https:// is specified?

@deathbeam
Copy link
Collaborator

deathbeam commented May 8, 2024

Are you sure you are specifing the proxy correctly? Usually proxy urls are just http. And from curl docs if you omit the protocol (e.g http://) it uses http:// by default. So I think you are just using wrong proxy url

EDIT:

For reference from curl manpage (the proxy param is passed straigth here):

       -x, --proxy [protocol://]host[:port]
              Use the specified proxy.

              The  proxy  string can be specified with a protocol:// prefix. No protocol specified or http:// it is treated as an HTTP proxy. Use socks4://, socks4a://, socks5:// or socks5h:// to
              request a specific SOCKS version to be used.

              Unix domain sockets are supported for socks proxy. Set localhost for the host part. e.g. socks5h://localhost/path/to/socket.sock

              HTTPS proxy support works set with the https:// protocol prefix for OpenSSL and GnuTLS (added in 7.52.0). It also works for BearSSL, mbedTLS, rustls, Schannel, Secure Transport  and
              wolfSSL (added in 7.87.0).

              Unrecognized and unsupported proxy protocols cause an error (added in 7.52.0).  Ancient curl versions ignored unknown schemes and used http:// instead.

              If the port number is not specified in the proxy string, it is assumed to be 1080.

              This option overrides existing environment variables that set the proxy to use. If there is an environment variable setting a proxy, you can set proxy to "" to override it.

              All  operations that are performed over an HTTP proxy are transparently converted to HTTP. It means that certain protocol specific operations might not be available. This is not the
              case if you can tunnel through the proxy, as one with the -p, --proxytunnel option.

              User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as @ by using %40 or pass in  a  colon  with
              %3a.

              The proxy host can be specified the same way as the proxy environment variables, including the protocol prefix (http://) and the embedded user + password.

              When a proxy is used, the active FTP mode as set with -P, --ftp-port, cannot be used.

              If --proxy is provided several times, the last set value is used.

              Example:
               curl --proxy http://proxy.example https://example.com

              See also --socks5 and --proxy-basic.

@deathbeam
Copy link
Collaborator

Also re: hanging indefinitely, this is probably something we should handle as error properly, do you have logs? See :CopilotChatDebugInfo,

@m8dotpie
Copy link
Author

m8dotpie commented May 8, 2024

Are you sure you are specifing the proxy correctly? Usually proxy urls are just http. And from curl docs if you omit the protocol (e.g http://) it uses http:// by default. So I think you are just using wrong proxy url

EDIT:

For reference from curl manpage (the proxy param is passed straigth here):

       -x, --proxy [protocol://]host[:port]
              Use the specified proxy.

              The  proxy  string can be specified with a protocol:// prefix. No protocol specified or http:// it is treated as an HTTP proxy. Use socks4://, socks4a://, socks5:// or socks5h:// to
              request a specific SOCKS version to be used.

              Unix domain sockets are supported for socks proxy. Set localhost for the host part. e.g. socks5h://localhost/path/to/socket.sock

              HTTPS proxy support works set with the https:// protocol prefix for OpenSSL and GnuTLS (added in 7.52.0). It also works for BearSSL, mbedTLS, rustls, Schannel, Secure Transport  and
              wolfSSL (added in 7.87.0).

              Unrecognized and unsupported proxy protocols cause an error (added in 7.52.0).  Ancient curl versions ignored unknown schemes and used http:// instead.

              If the port number is not specified in the proxy string, it is assumed to be 1080.

              This option overrides existing environment variables that set the proxy to use. If there is an environment variable setting a proxy, you can set proxy to "" to override it.

              All  operations that are performed over an HTTP proxy are transparently converted to HTTP. It means that certain protocol specific operations might not be available. This is not the
              case if you can tunnel through the proxy, as one with the -p, --proxytunnel option.

              User and password that might be provided in the proxy string are URL decoded by curl. This allows you to pass in special characters such as @ by using %40 or pass in  a  colon  with
              %3a.

              The proxy host can be specified the same way as the proxy environment variables, including the protocol prefix (http://) and the embedded user + password.

              When a proxy is used, the active FTP mode as set with -P, --ftp-port, cannot be used.

              If --proxy is provided several times, the last set value is used.

              Example:
               curl --proxy http://proxy.example https://example.com

              See also --socks5 and --proxy-basic.

Does not the manpage you provided say that https:// is a valid proxy protocol? Moreover, I use https:// with curl itself and it works fine I have unintentionally lied, it hangs, probably copilot.vim just ignores the protocol I specified.

@m8dotpie
Copy link
Author

m8dotpie commented May 8, 2024

Also re: hanging indefinitely, this is probably something we should handle as error properly, do you have logs? See :CopilotChatDebugInfo, does not provide anything useful or I just do not know how to use it properly:

If you are facing issues, run `:checkhealth CopilotChat` and share the output.

Log file path:
`/Users/m8dotpie/.local/state/nvim/CopilotChat.nvim.log`

Current buffer outline:
`/Users/m8dotpie/.config/nvim/copilot-chat`
```copilot-chat
## User ---

alive?

## Copilot ---

@jellydn jellydn added bug Something isn't working question Further information is requested labels May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants