update registry
This commit is contained in:
@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("forward", NewConnector)
|
||||
registry.ConnectorRegistry().Register("forward", NewConnector)
|
||||
}
|
||||
|
||||
type forwardConnector struct {
|
||||
@ -33,7 +33,7 @@ func (c *forwardConnector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *forwardConnector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -19,7 +19,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("http", NewConnector)
|
||||
registry.ConnectorRegistry().Register("http", NewConnector)
|
||||
}
|
||||
|
||||
type httpConnector struct {
|
||||
@ -43,7 +43,7 @@ func (c *httpConnector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *httpConnector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"local": conn.LocalAddr().String(),
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"network": network,
|
||||
|
@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("http2", NewConnector)
|
||||
registry.ConnectorRegistry().Register("http2", NewConnector)
|
||||
}
|
||||
|
||||
type http2Connector struct {
|
||||
@ -44,7 +44,7 @@ func (c *http2Connector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *http2Connector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"local": conn.LocalAddr().String(),
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"network": network,
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
|
||||
// Bind implements connector.Binder.
|
||||
func (c *relayConnector) Bind(ctx context.Context, conn net.Conn, network, address string, opts ...connector.BindOption) (net.Listener, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"network": network,
|
||||
"address": address,
|
||||
})
|
||||
|
@ -14,7 +14,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("relay", NewConnector)
|
||||
registry.ConnectorRegistry().Register("relay", NewConnector)
|
||||
}
|
||||
|
||||
type relayConnector struct {
|
||||
@ -38,7 +38,7 @@ func (c *relayConnector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *relayConnector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("sni", NewConnector)
|
||||
registry.ConnectorRegistry().Register("sni", NewConnector)
|
||||
}
|
||||
|
||||
type sniConnector struct {
|
||||
@ -34,7 +34,7 @@ func (c *sniConnector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *sniConnector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -15,8 +15,8 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("socks4", NewConnector)
|
||||
registry.RegiserConnector("socks4a", NewConnector)
|
||||
registry.ConnectorRegistry().Register("socks4", NewConnector)
|
||||
registry.ConnectorRegistry().Register("socks4a", NewConnector)
|
||||
}
|
||||
|
||||
type socks4Connector struct {
|
||||
@ -40,7 +40,7 @@ func (c *socks4Connector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *socks4Connector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
|
||||
// Bind implements connector.Binder.
|
||||
func (c *socks5Connector) Bind(ctx context.Context, conn net.Conn, network, address string, opts ...connector.BindOption) (net.Listener, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -17,8 +17,8 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("socks5", NewConnector)
|
||||
registry.RegiserConnector("socks", NewConnector)
|
||||
registry.ConnectorRegistry().Register("socks5", NewConnector)
|
||||
registry.ConnectorRegistry().Register("socks", NewConnector)
|
||||
}
|
||||
|
||||
type socks5Connector struct {
|
||||
@ -67,7 +67,7 @@ func (c *socks5Connector) Init(md md.Metadata) (err error) {
|
||||
|
||||
// Handshake implements connector.Handshaker.
|
||||
func (c *socks5Connector) Handshake(ctx context.Context, conn net.Conn) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
})
|
||||
@ -87,7 +87,7 @@ func (c *socks5Connector) Handshake(ctx context.Context, conn net.Conn) (net.Con
|
||||
}
|
||||
|
||||
func (c *socks5Connector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("ss", NewConnector)
|
||||
registry.ConnectorRegistry().Register("ss", NewConnector)
|
||||
}
|
||||
|
||||
type ssConnector struct {
|
||||
@ -51,7 +51,7 @@ func (c *ssConnector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *ssConnector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("ssu", NewConnector)
|
||||
registry.ConnectorRegistry().Register("ssu", NewConnector)
|
||||
}
|
||||
|
||||
type ssuConnector struct {
|
||||
@ -50,7 +50,7 @@ func (c *ssuConnector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *ssuConnector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
@ -12,7 +12,7 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
registry.RegiserConnector("sshd", NewConnector)
|
||||
registry.ConnectorRegistry().Register("sshd", NewConnector)
|
||||
}
|
||||
|
||||
type sshdConnector struct {
|
||||
@ -35,7 +35,7 @@ func (c *sshdConnector) Init(md md.Metadata) (err error) {
|
||||
}
|
||||
|
||||
func (c *sshdConnector) Connect(ctx context.Context, conn net.Conn, network, address string, opts ...connector.ConnectOption) (net.Conn, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
@ -59,7 +59,7 @@ func (c *sshdConnector) Connect(ctx context.Context, conn net.Conn, network, add
|
||||
|
||||
// Bind implements connector.Binder.
|
||||
func (c *sshdConnector) Bind(ctx context.Context, conn net.Conn, network, address string, opts ...connector.BindOption) (net.Listener, error) {
|
||||
log := c.options.Logger.WithFields(map[string]interface{}{
|
||||
log := c.options.Logger.WithFields(map[string]any{
|
||||
"remote": conn.RemoteAddr().String(),
|
||||
"local": conn.LocalAddr().String(),
|
||||
"network": network,
|
||||
|
Reference in New Issue
Block a user