Documentation
¶
Index ¶
- Constants
- Variables
- func FetchUrl(urlObj *url.URL, srcReq *http.Request, queryParams url.Values, ...) (*http.Response, error)
- func Generate(targetUrl, eid, key, publicurl, prefix string, cipher cipher.AEAD) (canonicalurl string, sign, encryptedurl, entryurl, encryptedEntryurl string)
- func NewReadCloserReplacer(src io.Reader, subs [][2]string, subrs [][2]string, subbs [][2][]byte) (io.ReadCloser, error)
- func Parse(prefix, fromurl, publicurl string) (plainurl, encryptedEntryurl, entryurl, eid string, err error)
- func ProxyFunc(w http.ResponseWriter, r *http.Request, prefix, key string, ...)
- func Realkey(key, keytype string) string
- type ReadCloserReplacer
- type Response
- type Template
Constants ¶
View Source
const ( HEADER_PREFIX = "header_" RESPONSE_HEADER_PREFIX = "resheader_" SUB_PREFIX = "sub_" SUBR_PREFIX = "subr_" SUBB_PREFIX = "subb_" CORS_STRING = "cors" NOCACHE_STRING = "nocache" NORF_STRING = "norf" PROXY_STRING = "proxy" IMPERSONATE_STRING = "impersonate" TRIMRESHEADER_STRING = "trimresheader" FORCESUB_STRING = "forcesub" NOCSP_STRING = "nocsp" TIMEOUT_STRING = "timeout" INSECURE_STRING = "insecure" COOKIE_STRING = "cookie" USER_STRING = "user" AUTH_STRING = "auth" // entrypoint url http authorization, username:password FDHEADERS_STRING = "fdheaders" BODY_STRING = "body" RESBODY_STRING = "resbody" RESBODYTYPE_STRING = "resbodytype" TYPE_STRING = "type" RESTYPE_STRING = "restype" METHOD_STRING = "method" REFERER_STRING = "referer" ORIGIN_STRING = "origin" SCOPE_STRING = "scope" SIGN_STRING = "sign" KEYTYPE_STRING = "keytype" VALIDBEFORE_STRING = "validbefore" VALIDAFTER_STRING = "validafter" RESPASS_STRING = "respass" // response body encryption password EID_STRING = "eid" // encrypt url id STATUS_STRING = "status" ENCMODE_STRING = "encmode" AUTHMODE_STRING = "authmode" TPLMODE_STRING = "tplmode" RESBODYTPL_STRING = "resbodytpl" // use response body as template. path suffix, e.g. ".sgp.txt" DEBUG_STRING = "debug" EPATH_STRING = "epath" // allow subpath in encrypted url SALT_STRING = "salt" ARG_SRING = "arg" ARGS_SRING = "args" )
View Source
const NOBODY = "NOBODY"
Variables ¶
View Source
var NoSignParameters = []string{SIGN_STRING, KEYTYPE_STRING, SALT_STRING}
These params do not participate in url signing, sign, keytype, salt.
Functions ¶
func NewReadCloserReplacer ¶ added in v0.12.0
func NewReadCloserReplacer(src io.Reader, subs [][2]string, subrs [][2]string, subbs [][2][]byte) (io.ReadCloser, error)
Return a ReadCloser stream that do find-and-replacements to src on the fly. The Close func of returned value is no-op if src ifself is not a Closer.
func ProxyFunc ¶
func ProxyFunc(w http.ResponseWriter, r *http.Request, prefix, key string, keytypeBlacklist, openScopes []string, openNormal, supressError, doLog bool, enableUnix, enableFile, enableRclone, enableCurl, enableExec bool, rcloneBinary, rcloneConfig, curlBinary string, cipher cipher.AEAD, authenticator *auth.Auth)
func Realkey ¶
key and keytype are guaranteed to do not contain \n. Put keytype (plaintext) first, to increase security against length extension attack. See https://en.wikipedia.org/wiki/Length_extension_attack . We use HMAC to derive signing key from Realkey() output, so it's only a double security.
Types ¶
type ReadCloserReplacer ¶ added in v0.12.0
func (*ReadCloserReplacer) Close ¶ added in v0.12.0
func (r *ReadCloserReplacer) Close() error
Click to show internal directories.
Click to hide internal directories.