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 method #2

Open
hmert opened this issue Sep 19, 2021 · 1 comment
Open

Proxy method #2

hmert opened this issue Sep 19, 2021 · 1 comment
Assignees

Comments

@hmert
Copy link
Member

hmert commented Sep 19, 2021

-x, --proxy [protocol://]host[:port] Use this proxy
     --proxy-anyauth Pick any proxy authentication method
     --proxy-basic   Use Basic authentication on the proxy
     --proxy-cacert <file> CA certificate to verify peer against for proxy
     --proxy-capath <dir> CA directory to verify peer against for proxy
     --proxy-cert <cert[:passwd]> Set client certificate for proxy
     --proxy-cert-type <type> Client certificate type for HTTPS proxy
     --proxy-ciphers <list> SSL ciphers to use for proxy
     --proxy-crlfile <file> Set a CRL list for proxy
     --proxy-digest  Use Digest authentication on the proxy
     --proxy-header <header/@file> Pass custom header(s) to proxy
     --proxy-insecure Do HTTPS proxy connections without verifying the proxy
     --proxy-key <key> Private key for HTTPS proxy
     --proxy-key-type <type> Private key file type for proxy
     --proxy-negotiate Use HTTP Negotiate (SPNEGO) authentication on the proxy
     --proxy-ntlm    Use NTLM authentication on the proxy
     --proxy-pass <phrase> Pass phrase for the private key for HTTPS proxy
     --proxy-pinnedpubkey <hashes> FILE/HASHES public key to verify proxy with
     --proxy-service-name <name> SPNEGO proxy service name
     --proxy-ssl-allow-beast Allow security flaw for interop for HTTPS proxy
     --proxy-tls13-ciphers <ciphersuite list> TLS 1.3 proxy cipher suites
     --proxy-tlsauthtype <type> TLS authentication type for HTTPS proxy
     --proxy-tlspassword <string> TLS password for HTTPS proxy
     --proxy-tlsuser <name> TLS username for HTTPS proxy
     --proxy-tlsv1   Use TLSv1 for HTTPS proxy
 -U, --proxy-user <user:password> Proxy user and password
     --proxy1.0 <host[:port]> Use HTTP/1.0 proxy on given port
 -p, --proxytunnel   Operate through an HTTP proxy tunnel (using CONNECT)
@gozeloglu gozeloglu self-assigned this Sep 19, 2021
@gozeloglu
Copy link
Collaborator

Hi @hmert. I have an idea for implementing proxy commands to more clear. I wanted to get approval from you. proxy.go file is starting to be more complicated and messy for future commands. I was writing code for --proxy-digest flag and I had to modify proxyUserCmd by adding a new parameter. But, adding a new parameter affects to proxy_test.go file and proxyUserCredentials, err := proxyUserCmd(proxyUser) line. I think this problem will grow and be a problem. Maybe, refactoring will be necessary for each flag. That's why I think we can define a struct as follows:

type GurlProxy struct {
	proxyURL  string
	proxyUser string
	username  string
	password  string
	basic     bool
	digest    bool
	ntlm      bool
	negotiate bool
}

This struct may grow in the future, but I think, in this way, we suffer less pain. I am going to store necessary information as a struct and I'll convert functions to methods like func (g *GurlProxy) proxyCmd() (string, error). What do you think about that?

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