Merge pull request #1037 from yggdrasil-network/neil/quic

QUIC interface support
This commit is contained in:
Arceliar 2023-06-19 06:27:09 -05:00 committed by GitHub
commit 7f94463332
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 160 additions and 0 deletions

View file

@ -34,6 +34,7 @@ type links struct {
tls *linkTLS // TLS interface support
unix *linkUNIX // UNIX interface support
socks *linkSOCKS // SOCKS interface support
quic *linkQUIC // QUIC interface support
// _links can only be modified safely from within the links actor
_links map[linkInfo]*link // *link is nil if connection in progress
}
@ -89,6 +90,7 @@ func (l *links) init(c *Core) error {
l.tls = l.newLinkTLS(l.tcp)
l.unix = l.newLinkUNIX()
l.socks = l.newLinkSOCKS()
l.quic = l.newLinkQUIC()
l._links = make(map[linkInfo]*link)
var listeners []ListenAddress
@ -328,6 +330,8 @@ func (l *links) listen(u *url.URL, sintf string) (*Listener, error) {
protocol = l.tls
case "unix":
protocol = l.unix
case "quic":
protocol = l.quic
default:
cancel()
return nil, ErrLinkUnrecognisedSchema
@ -464,6 +468,8 @@ func (l *links) connect(u *url.URL, info linkInfo, options linkOptions) (net.Con
dialer = l.socks
case "unix":
dialer = l.unix
case "quic":
dialer = l.quic
default:
return nil, ErrLinkUnrecognisedSchema
}