wireguard.go 543 B

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