Documentation ¶
Overview ¶
Package controller holds all handlers and handler functions as well as necessary infrastructure for session management and security
Parse all templates once and make them globally available
Index ¶
- Constants
- func GetHttpPort() string
- func GetLogInOutPath() string
- func GetProxies() map[string]*httputil.ReverseProxy
- func GetTargets() map[string][]string
- func GetTlsPort() string
- func GetUsers() map[string]model.User
- func InitRouter() *mux.Router
- func IsStealthMode() bool
- func MakeLinks(userName string) (map[string]string, map[string]string)
- func RedirectHTTP(w http.ResponseWriter, r *http.Request)
- func RequestLogger(h http.Handler) http.Handler
- func ResourceBase(projectBase string) string
- func SessionChecker(h http.Handler) http.Handler
- func SessionStore() sessions.Store
- func SetupConfig(cfgfile string)
- func Templates(projectBase string)
- func Views() *template.Template
- type HandlerSwitch
- type Refmap
- type Viewmodel
Constants ¶
const Base = "src/github.com/geobe/https-proxy"
the relative location of project files
const S_PROXY = "Proxy-App-Session"
keys for the session store
Variables ¶
This section is empty.
Functions ¶
func GetHttpPort ¶
func GetHttpPort() string
func GetLogInOutPath ¶
func GetLogInOutPath() string
func GetProxies ¶
func GetProxies() map[string]*httputil.ReverseProxy
func GetTargets ¶
func GetTlsPort ¶
func GetTlsPort() string
func InitRouter ¶
func IsStealthMode ¶
func IsStealthMode() bool
func MakeLinks ¶
* create two maps<br> links: random key -> human readable link<br> ref: random key -> target key
func RedirectHTTP ¶
func RedirectHTTP(w http.ResponseWriter, r *http.Request)
RedirectHTTP is an HTTP handler (suitable for use with http.HandleFunc) that responds to all requests by redirecting to the same URL served over HTTPS. It should only be invoked for requests received over HTTP.
func RequestLogger ¶
RequestLogger uses logRequest function to log request info to log output
func ResourceBase ¶
* return base directory of static resources like styles, images or templates projectBase base path of the project
func SessionChecker ¶
SessionChecker filter checks if there is a valid session, i.e if someone is logged in
func SetupConfig ¶
func SetupConfig(cfgfile string)
* set up viper configuration lib and initialize data from configuration file
Types ¶
type HandlerSwitch ¶
struct to hold different route multiplexer. Internal calls from the same local net will be directly routed by Mux, else redirect to Redirect that shall redirect to HTTPS
func (*HandlerSwitch) ServeHTTP ¶
func (h *HandlerSwitch) ServeHTTP(w http.ResponseWriter, r *http.Request)
Handler function that redirects access from external internet to redirect handler. Local is directly routed to MUX.