ftp

package module
v0.0.0-...-52b0943 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: MIT Imports: 10 Imported by: 0

README

caddy-ftp

access ftp through caddy

usage

{
  auto_https off
  http_port 80
  https_port 443
}

:80 {
    route /abc/* {
        uri replace /abc/ /
        ftp {
            addr test.rebex.net:21
            user demo
            pass password
            # dial_timeout 3s
            # disable_epsv
            # disable_utf8
        }
    }
    # curl localhost:80/abc/pub/example/imap-console-client.png
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTP4Ftp

type HTTP4Ftp struct {
	Addr         string        `json:"addr"`
	User         string        `json:"user"`
	Pass         string        `json:"pass"`
	DialTimeout  time.Duration `json:"dial_timeout"`
	DisabledEPSV bool          `json:"disable_epsv"`
	DisabledMLSD bool          `json:"disable_mlsd"`
	DisableUTF8  bool          `json:"disable_utf8"`
}

func (HTTP4Ftp) CaddyModule

func (h4f HTTP4Ftp) CaddyModule() caddy.ModuleInfo

CaddyModule returns the Caddy module information.

func (HTTP4Ftp) ServeHTTP

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

func (*HTTP4Ftp) UnmarshalCaddyfile

func (h4f *HTTP4Ftp) UnmarshalCaddyfile(d *caddyfile.Dispenser) (err error)

UnmarshalCaddyfile sets up the handler from Caddyfile tokens. Syntax: Specifying the formats on the first line will use those formats' defaults.

func (*HTTP4Ftp) Validate

func (h4f *HTTP4Ftp) Validate() (err error)

Validate implements caddy.Validator.

type ResponseWriter

type ResponseWriter struct {
	http.ResponseWriter
	// contains filtered or unexported fields
}

func (*ResponseWriter) Write

func (rw *ResponseWriter) Write(p []byte) (int, error)

Here we are implementing a Write() function from ResponseWriter with our custom instructions.

func (*ResponseWriter) WriteHeader

func (rw *ResponseWriter) WriteHeader(statusCode int)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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