Add IPv6 overlay address support to client interface and engine

This commit is contained in:
Viktor Liu
2026-03-25 09:55:44 +01:00
parent 013770070a
commit b852ce1a99
60 changed files with 4076 additions and 1646 deletions
+6 -1
View File
@@ -5,6 +5,7 @@ package main
import (
"context"
"fmt"
"net"
"syscall/js"
"time"
@@ -81,6 +82,10 @@ func parseClientOptions(jsOptions js.Value) (netbird.Options, error) {
options.DeviceName = deviceName.String()
}
if disableIPv6 := jsOptions.Get("disableIPv6"); !disableIPv6.IsNull() && !disableIPv6.IsUndefined() {
options.DisableIPv6 = disableIPv6.Bool()
}
return options, nil
}
@@ -227,7 +232,7 @@ func performPingTCP(client *netbird.Client, hostname string, port int) {
ctx, cancel := context.WithTimeout(context.Background(), pingTimeout)
defer cancel()
address := fmt.Sprintf("%s:%d", hostname, port)
address := net.JoinHostPort(hostname, fmt.Sprintf("%d", port))
start := time.Now()
conn, err := client.Dial(ctx, "tcp", address)
if err != nil {
+1 -1
View File
@@ -82,7 +82,7 @@ func NewRDCleanPathProxy(client interface {
// CreateProxy creates a new proxy endpoint for the given destination
func (p *RDCleanPathProxy) CreateProxy(hostname, port string) js.Value {
destination := fmt.Sprintf("%s:%s", hostname, port)
destination := net.JoinHostPort(hostname, port)
return js.Global().Get("Promise").New(js.FuncOf(func(_ js.Value, args []js.Value) any {
resolve := args[0]
+2 -1
View File
@@ -6,6 +6,7 @@ import (
"context"
"fmt"
"io"
"net"
"sync"
"time"
@@ -47,7 +48,7 @@ func NewClient(nbClient *netbird.Client) *Client {
// Connect establishes an SSH connection through NetBird network
func (c *Client) Connect(host string, port int, username, jwtToken string) error {
addr := fmt.Sprintf("%s:%d", host, port)
addr := net.JoinHostPort(host, fmt.Sprintf("%d", port))
logrus.Infof("SSH: Connecting to %s as %s", addr, username)
authMethods, err := c.getAuthMethods(jwtToken)