mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-06 11:48:47 +00:00
v1.0.0
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package noop
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
|
||||
"github.com/xtls/xray-core/v1/common"
|
||||
)
|
||||
|
||||
type NoOpHeader struct{}
|
||||
|
||||
func (NoOpHeader) Size() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Serialize implements PacketHeader.
|
||||
func (NoOpHeader) Serialize([]byte) {}
|
||||
|
||||
func NewNoOpHeader(context.Context, interface{}) (interface{}, error) {
|
||||
return NoOpHeader{}, nil
|
||||
}
|
||||
|
||||
type NoOpConnectionHeader struct{}
|
||||
|
||||
func (NoOpConnectionHeader) Client(conn net.Conn) net.Conn {
|
||||
return conn
|
||||
}
|
||||
|
||||
func (NoOpConnectionHeader) Server(conn net.Conn) net.Conn {
|
||||
return conn
|
||||
}
|
||||
|
||||
func NewNoOpConnectionHeader(context.Context, interface{}) (interface{}, error) {
|
||||
return NoOpConnectionHeader{}, nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
common.Must(common.RegisterConfig((*Config)(nil), NewNoOpHeader))
|
||||
common.Must(common.RegisterConfig((*ConnectionConfig)(nil), NewNoOpConnectionHeader))
|
||||
}
|
||||
Reference in New Issue
Block a user