server

package
v0.20.4 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// NmProxyServer - proxy server for global access
	NmProxyServer = &ProxyServer{}
)

Functions

func ProcessIncomingPacket added in v0.19.0

func ProcessIncomingPacket(n int, source string, buffer []byte)

ProcessIncomingPacket - process the incoming packet to the proxy

Types

type Config

type Config struct {
	Port     int
	BodySize int
}

Config - struct for proxy server config

type ProxyServer

type ProxyServer struct {
	Config Config
	Server *net.UDPConn
}

ProxyServer - struct for proxy server

func (*ProxyServer) Close

func (p *ProxyServer) Close()

ProxyServer.Close - closes the proxy server

func (*ProxyServer) CreateProxyServer

func (p *ProxyServer) CreateProxyServer(port, bodySize int, addr string) (err error)

ProxyServer.CreateProxyServer - creats a proxy listener port - port for proxy to listen on localhost bodySize - leave 0 to use default addr - the address for proxy to listen on

func (*ProxyServer) KeepAlive

func (p *ProxyServer) KeepAlive(ip string, port int)

func (*ProxyServer) Listen

func (p *ProxyServer) Listen(ctx context.Context, wg *sync.WaitGroup)

Proxy.Listen - begins listening for packets

Jump to

Keyboard shortcuts

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