apple / pkl-go

Pkl bindings for the Go programming language
https://pkl-lang.org/go/current/index.html
Apache License 2.0
257 stars 22 forks source link

How to set http_proxy? #100

Open arun0009 opened 2 weeks ago

arun0009 commented 2 weeks ago

How can I set http proxy?

I'm getting SSL handshake error:

pkl-gen-go --help
panic: –– Pkl Error ––
    Exception when making request `GET https://pkg.pkl-lang.org/pkl-go/pkl.golang@0.8.0`:
    Error during SSL handshake with host `pkg.pkl-lang.org`:
    Connection reset
HT154 commented 1 week ago

There's no way to directly configure an HTTP proxy on the pkl-gen-go CLI, but it looks like you may be able to specify one via a PklProject file. In a PklProject file:

evaluatorSettings {
  http {
    proxy {
      address = "proxy.example.com:80"
      noProxy { "internal.example.com"; "localhost" }
    }
  }
}

This file needs to be in the directory where you run pkl-gen-go, a parent directory, or in the directory specified by the --project-dir flag.