mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-08-06 13:18:30 +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:
24
src/mod/forwardproxy/cproxy/logging_initializer.go
Normal file
24
src/mod/forwardproxy/cproxy/logging_initializer.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package cproxy
|
||||
|
||||
type loggingInitializer struct {
|
||||
logger logger
|
||||
inner initializer
|
||||
}
|
||||
|
||||
func newLoggingInitializer(config *configuration) initializer {
|
||||
if !config.LogConnections {
|
||||
return config.Initializer
|
||||
}
|
||||
|
||||
return &loggingInitializer{inner: config.Initializer, logger: config.Logger}
|
||||
}
|
||||
|
||||
func (this *loggingInitializer) Initialize(client, server Socket) bool {
|
||||
result := this.inner.Initialize(client, server)
|
||||
|
||||
if !result {
|
||||
this.logger.Printf("[INFO] Connection failed [%s] -> [%s]", client.RemoteAddr(), server.RemoteAddr())
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
Reference in New Issue
Block a user