proxyparser

package module
v0.0.0-...-a077efb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 25, 2024 License: MIT Imports: 3 Imported by: 0

README

Go-ProxyParser

Library in Golang to parse proxy URL details

Installation

go get github.com/snekROmonoro/Go-ProxyParser

Usage

import (
  proxyparser "github.com/snekROmonoro/Go-ProxyParser"
)

...

var proxyStr = "http://username:password@host:port"
var ProxyData *proxyparser.ProxyData
var parsedProxySuccessfully = false

ProxyData, parsedProxySuccessfully = proxyparser.GetProxyData(proxyStr)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProxyData

type ProxyData struct {
	Scheme   string
	Hostname string
	Port     string

	// user:password format
	UserString string
}

func GetProxyData

func GetProxyData(rawProxy string) (ProxyData, bool)

Allowed Formats: {scheme://user:pass@host:port}, {scheme://host:port}

The scheme can be NOT provided. "http" will be provided by default.

After the scheme there must ALWAYS be either ":" or "://"

Returns {ProxyData, SuccessParsing}

func (ProxyData) String

func (d ProxyData) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL