Refactor wireguard & add tun support

This commit is contained in:
世界
2022-09-06 00:15:09 +08:00
parent 8e7957d440
commit cb4fea0240
20 changed files with 792 additions and 425 deletions

View File

@@ -0,0 +1,22 @@
package wireguard
import "net"
type wireError struct {
cause error
}
func (w *wireError) Error() string {
return w.cause.Error()
}
func (w *wireError) Timeout() bool {
if cause, causeNet := w.cause.(net.Error); causeNet {
return cause.Timeout()
}
return false
}
func (w *wireError) Temporary() bool {
return true
}