wireguard.go 551 B

12345678910111213141516171819202122232425262728
  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. // Write implements io.Writer.
  11. func (Wireguard) Write(b []byte) (int, error) {
  12. b = append(b[:0], 0x04, 0x00, 0x00, 0x00)
  13. return 4, nil
  14. }
  15. // NewWireguard returns a new VideoChat instance based on given config.
  16. func NewWireguard(ctx context.Context, config interface{}) (interface{}, error) {
  17. return Wireguard{}, nil
  18. }
  19. func init() {
  20. common.Must(common.RegisterConfig((*WireguardConfig)(nil), NewWireguard))
  21. }