mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-09 14:47:47 +02:00
3.0.1 init commit
- Removed Go HTTP client UA - Added optional bypass of websocket origin check #107 - Added basic forward proxy for debug - Fixed UI error in network utils tab
This commit is contained in:
67
src/mod/forwardproxy/cproxy/interfaces.go
Normal file
67
src/mod/forwardproxy/cproxy/interfaces.go
Normal file
@@ -0,0 +1,67 @@
|
||||
package cproxy
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type (
|
||||
Filter interface {
|
||||
IsAuthorized(http.ResponseWriter, *http.Request) bool
|
||||
}
|
||||
|
||||
clientConnector interface {
|
||||
Connect(http.ResponseWriter) Socket
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
Dialer interface {
|
||||
Dial(string) Socket
|
||||
}
|
||||
|
||||
serverConnector interface {
|
||||
Connect(Socket, string) proxy
|
||||
}
|
||||
|
||||
initializer interface {
|
||||
Initialize(Socket, Socket) bool
|
||||
}
|
||||
|
||||
proxy interface {
|
||||
Proxy()
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
Socket interface {
|
||||
io.ReadWriteCloser
|
||||
RemoteAddr() net.Addr
|
||||
}
|
||||
|
||||
tcpSocket interface {
|
||||
Socket
|
||||
CloseRead() error
|
||||
CloseWrite() error
|
||||
}
|
||||
)
|
||||
|
||||
type (
|
||||
monitor interface {
|
||||
Measure(int)
|
||||
}
|
||||
logger interface {
|
||||
Printf(string, ...interface{})
|
||||
}
|
||||
)
|
||||
|
||||
const (
|
||||
MeasurementHTTPRequest int = iota
|
||||
MeasurementBadMethod
|
||||
MeasurementUnauthorizedRequest
|
||||
MeasurementClientConnectionFailed
|
||||
MeasurementServerConnectionFailed
|
||||
MeasurementProxyReady
|
||||
MeasurementProxyComplete
|
||||
)
|
Reference in New Issue
Block a user