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

I want to use it in a Proxy environment #58

Open
hiranoqueworks opened this issue Sep 21, 2022 · 3 comments
Open

I want to use it in a Proxy environment #58

hiranoqueworks opened this issue Sep 21, 2022 · 3 comments

Comments

@hiranoqueworks
Copy link

hiranoqueworks commented Sep 21, 2022

Request

Reason :
I want to use it in a Proxy environment

Make a request
connection.go
Line:16
var transport = http.Transport{}

Don't initialize with empty, just use
DefaultTransport
or
or add the following function
func SetTransport(h http.Transport) {
transport = h
}

Example :
http.DefaultTransport = &http.Transport{ Proxy: http.ProxyURL(proxyUrl) }
I want to use defaultTransport and use it around like
Or
tr := &http.Transport{
ResponseHeaderTimeout: 30 * time.Second,
Proxy: http.ProxyFromEnvironment,
DialContext: (&net.Dialer{
Timeout: 2 * time.Second,
}).DialContext,
MaxIdleConns: 0,
IdleConnTimeout: 30 * time.Second,
TLSHandshakeTimeout: 2 * time.Second, }),
Second, MaxIdleConnsPerHost: 100,
//DisableKeepAlives: false,
DisableKeepAlives: true,
}
solr.SetTransport(tr)

Please.

@vanng822
Copy link
Owner

I don't remember all those changes. However, I think it may be good to start with default
var transport = http.DefaultTransport
And having a set function for those that need to keep DefaultTransport as it is but want this transport different.

Do you have time help with a PR? I am lack of time and lock of development tools

@hiranoqueworks
Copy link
Author

You can do it that way

var transport = http.DefaultTransport

Can I modify it and pull request?

@vanng822
Copy link
Owner

Yes we can start with it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants