proxy

package module
v0.0.0-...-74307b3 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2019 License: MIT Imports: 10 Imported by: 1

README

bulrush-proxy

Lightweight HTTP proxy for bulrush

var Proxy = &proxy.Proxy{
	Host:  "https://www.baidu.com",
	Match: "^/proxy",
	Map: func(reqPath string) string {
		return reqPath
	},
}

MIT License

Copyright (c) 2018-2020 Double

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Documentation

Index

Constants

This section is empty.

Variables

RushLogger for app logger

Functions

This section is empty.

Types

type Option

type Option func(*Proxy) interface{}

Option defined implement of option

func ReqOption

func ReqOption(req func(*http.Request, *http.Request) *http.Request) Option

ReqOption defined req

func ResOption

func ResOption(res func(gin.ResponseWriter, *http.Response)) Option

ResOption defined res

type Proxy

type Proxy struct {
	URL   string
	Host  string
	Match string
	Map   func(string) string
	// contains filtered or unexported fields
}

Proxy http proxy

func (*Proxy) AddOptions

func (proxy *Proxy) AddOptions(opts ...Option) *Proxy

AddOptions defined add option

func (*Proxy) Plugin

func (proxy *Proxy) Plugin(httpProxy *gin.Engine)

Plugin for gin

Jump to

Keyboard shortcuts

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