Store types in variable instead of returns

This commit is contained in:
perp 2024-07-25 16:16:07 +01:00
parent 77bb7b3e94
commit f1b5ba900e
1 changed files with 4 additions and 1 deletions

View File

@ -10,13 +10,16 @@ import (
)
// Transport will return a http.Transport for the proxy protocol
func Transport(proxy string) (scheme string, transport *http.Transport, err error) {
func Transport(proxy string) (string, *http.Transport, error) {
// Parse URL
proxyURL, err := url.Parse(proxy)
if err != nil {
return "", nil, err
}
// Store transport
var transport *http.Transport
// Check scheme & create transport
switch proxyURL.Scheme {
case "socks5", "socks4", "socks4a":