proxysrv

package
v0.0.0-...-9c55465 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package proxysrv provides a proxy server for Kite.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Port       int
	Rules      []string
	RuleFiles  []string
	RuleDirs   []string
	GlobalVars map[string]string
}

Config struct

type ConfigFn

type ConfigFn func(c *Config)

type ProxyRule

type ProxyRule struct {
	Name  string // id name
	Group string
	Index int // index in rules
	Sort  int // sort number

	// Protocol name of rule. http, https, ws, wss, file, ...
	Protocol string

	// Pattern from host or path
	Pattern string
	// Operate dist host or path
	Operate string
	// Config for the rule
	Config map[string]string
}

ProxyRule definition

type ProxySrv

type ProxySrv struct {
	*Config
	Rules []*ProxyRule
}

ProxySrv struct

refer:

func NewProxySrv

func NewProxySrv(fns ...ConfigFn) *ProxySrv

NewProxySrv create a new ProxySrv instance

func (*ProxySrv) Start

func (s *ProxySrv) Start() error

Jump to

Keyboard shortcuts

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