2016-12-08 10:27:41 -05:00
|
|
|
package noop
|
|
|
|
|
|
|
|
import (
|
2017-01-12 16:47:10 -05:00
|
|
|
"context"
|
2016-12-08 10:27:41 -05:00
|
|
|
"net"
|
|
|
|
|
2022-01-02 10:16:23 -05:00
|
|
|
"github.com/v2fly/v2ray-core/v5/common"
|
2016-12-08 10:27:41 -05:00
|
|
|
)
|
|
|
|
|
2020-11-21 16:05:01 -05:00
|
|
|
type Header struct{}
|
2016-12-08 10:27:41 -05:00
|
|
|
|
2020-11-21 16:05:01 -05:00
|
|
|
func (Header) Size() int32 {
|
2016-12-08 10:27:41 -05:00
|
|
|
return 0
|
|
|
|
}
|
2017-04-21 09:36:05 -04:00
|
|
|
|
2018-11-02 16:34:04 -04:00
|
|
|
// Serialize implements PacketHeader.
|
2020-11-21 16:05:01 -05:00
|
|
|
func (Header) Serialize([]byte) {}
|
2016-12-08 10:27:41 -05:00
|
|
|
|
2020-11-21 16:05:01 -05:00
|
|
|
func NewHeader(context.Context, interface{}) (interface{}, error) {
|
|
|
|
return Header{}, nil
|
2016-12-08 10:27:41 -05:00
|
|
|
}
|
|
|
|
|
2020-11-21 16:05:01 -05:00
|
|
|
type ConnectionHeader struct{}
|
2016-12-08 10:27:41 -05:00
|
|
|
|
2020-11-21 16:05:01 -05:00
|
|
|
func (ConnectionHeader) Client(conn net.Conn) net.Conn {
|
2016-12-08 10:27:41 -05:00
|
|
|
return conn
|
|
|
|
}
|
|
|
|
|
2020-11-21 16:05:01 -05:00
|
|
|
func (ConnectionHeader) Server(conn net.Conn) net.Conn {
|
2016-12-08 10:27:41 -05:00
|
|
|
return conn
|
|
|
|
}
|
|
|
|
|
2020-11-21 16:05:01 -05:00
|
|
|
func NewConnectionHeader(context.Context, interface{}) (interface{}, error) {
|
|
|
|
return ConnectionHeader{}, nil
|
2016-12-08 10:27:41 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2020-11-21 16:05:01 -05:00
|
|
|
common.Must(common.RegisterConfig((*Config)(nil), NewHeader))
|
|
|
|
common.Must(common.RegisterConfig((*ConnectionConfig)(nil), NewConnectionHeader))
|
2016-12-08 10:27:41 -05:00
|
|
|
}
|