shadowsocks

package module
v0.0.0-...-2d0bd0b Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

README

Caddy-Shadowsocks-tls

Build with xcaddy

$ xcaddy build \
    --with github.com/imgk/caddy-shadowsocks-tls

Config

{
    "apps": {
        "http": {
            "servers": {
                "": {
                    "routes": [
                        {
                            "handle": [
                                {
                                    "handler": "shadowsocks_tls",
                                    "server": "127.0.0.1:8388",
                                    "users": ["password-1", "password-2"]
                                }
                            ]
                        }
                    ]
                }
            }
        }
    }
}

Documentation

Index

Constants

View Source
const AuthLen = 82

AuthLen is the length is http basic auth len(GenKey("Test1234"))

Variables

This section is empty.

Functions

func GenKey

func GenKey(s string) string

GenKey is ...

func HandleTCP

func HandleTCP(r io.Reader, w io.Writer, raddr *net.TCPAddr) error

HandleTCP is ...

func HandleUDP

func HandleUDP(r io.Reader, w io.Writer, raddr *net.UDPAddr, timeout time.Duration) error

HandleUDP is ...

func StringToByteSlice

func StringToByteSlice(s string) []byte

StringToByteSlice is ...

Types

type Conn

type Conn struct {
	// contains filtered or unexported fields
}

Conn is ...

func (*Conn) CloseWrite

func (c *Conn) CloseWrite() error

CloseWrite: *net.TCPConn and *tls.Conn

func (*Conn) Read

func (c *Conn) Read(b []byte) (int, error)

Read is ...

func (*Conn) Write

func (c *Conn) Write(b []byte) (int, error)

Write is ...

type FlushWriter

type FlushWriter struct {
	// contains filtered or unexported fields
}

FlushWriter is ...

func (*FlushWriter) Write

func (c *FlushWriter) Write(b []byte) (n int, err error)

Write is ...

type Handler

type Handler struct {
	// Server is ...
	// shadowsocks server
	Server string `json:"server,omitempty"`
	// ShadowBox is ...
	// outline server
	ShadowBox string `json:"shadowbox,omitempty"`
	// Users is ...
	// shadowsoscks users
	Users []string `json:"users,omitempty"`
	// contains filtered or unexported fields
}

Handler implements an HTTP handler that ...

func (Handler) CaddyModule

func (Handler) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (*Handler) Provision

func (m *Handler) Provision(ctx caddy.Context) (err error)

Provision implements caddy.Provisioner.

func (*Handler) ServeHTTP

func (m *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error

ServeHTTP implements caddyhttp.MiddlewareHandler.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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