github.com/xraypb/xray-core@v1.6.6/transport/internet/headers/wireguard/wireguard.go (about)

     1  package wireguard
     2  
     3  import (
     4  	"context"
     5  
     6  	"github.com/xraypb/xray-core/common"
     7  )
     8  
     9  type Wireguard struct{}
    10  
    11  func (Wireguard) Size() int32 {
    12  	return 4
    13  }
    14  
    15  // Serialize implements PacketHeader.
    16  func (Wireguard) Serialize(b []byte) {
    17  	b[0] = 0x04
    18  	b[1] = 0x00
    19  	b[2] = 0x00
    20  	b[3] = 0x00
    21  }
    22  
    23  // NewWireguard returns a new VideoChat instance based on given config.
    24  func NewWireguard(ctx context.Context, config interface{}) (interface{}, error) {
    25  	return Wireguard{}, nil
    26  }
    27  
    28  func init() {
    29  	common.Must(common.RegisterConfig((*WireguardConfig)(nil), NewWireguard))
    30  }