mirror of
https://github.com/netbirdio/netbird.git
synced 2026-04-18 16:26:38 +00:00
chore: add webrtc bind base
This commit is contained in:
3
browser/Makefile
Normal file
3
browser/Makefile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
run:
|
||||||
|
GOOS=js GOARCH=wasm go build -o assets/tun.wasm ./wasm/
|
||||||
|
go run main.go
|
||||||
@@ -28,7 +28,6 @@
|
|||||||
<label for="peerAllowedIPs">Wireguard Peer AllowedIPs:</label>
|
<label for="peerAllowedIPs">Wireguard Peer AllowedIPs:</label>
|
||||||
<input id="peerAllowedIPs" type=input size="50" value="Paste other peer AllowedIPs">
|
<input id="peerAllowedIPs" type=input size="50" value="Paste other peer AllowedIPs">
|
||||||
<p/>
|
<p/>
|
||||||
<!--<input type=button value="wgPrivateKey" onclick='wgPrivateKey(prompt("Wireguard Private Key", ""))'>-->
|
|
||||||
<input type=button value="start" onclick='connect()'>
|
<input type=button value="start" onclick='connect()'>
|
||||||
</form>
|
</form>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
Binary file not shown.
39
browser/client/client.go
Normal file
39
browser/client/client.go
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/hex"
|
||||||
|
"fmt"
|
||||||
|
conn2 "golang.zx2c4.com/wireguard/conn"
|
||||||
|
"golang.zx2c4.com/wireguard/device"
|
||||||
|
"golang.zx2c4.com/wireguard/tun/netstack"
|
||||||
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||||
|
"net"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
tun, _, err := netstack.CreateNetTUN(
|
||||||
|
[]net.IP{net.ParseIP("10.100.0.2")},
|
||||||
|
[]net.IP{net.ParseIP("8.8.8.8")},
|
||||||
|
1420)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
clientKey, _ := wgtypes.ParseKey("WI+uoQD9jGi+nyifmFwmswQu5r0uWFH31WeSmfU0snI=")
|
||||||
|
serverKey, _ := wgtypes.ParseKey("kLpbgt+g2+g8x556VmsLYyhTh77WmKfaFB0x+LcVyWY=")
|
||||||
|
publicServerkey := serverKey.PublicKey()
|
||||||
|
|
||||||
|
dev := device.NewDevice(tun, conn2.NewStdNetBind(), device.NewLogger(device.LogLevelVerbose, ""))
|
||||||
|
|
||||||
|
err = dev.IpcSet(fmt.Sprintf("private_key=%s\npublic_key=%s\npersistent_keepalive_interval=5\nendpoint=65.108.52.126:50000\nallowed_ip=0.0.0.0/0",
|
||||||
|
hex.EncodeToString(clientKey[:]),
|
||||||
|
hex.EncodeToString(publicServerkey[:]),
|
||||||
|
))
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
select {}
|
||||||
|
}
|
||||||
51
browser/conn/bind_webrtc.go
Normal file
51
browser/conn/bind_webrtc.go
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
package conn
|
||||||
|
|
||||||
|
import "net"
|
||||||
|
import "golang.zx2c4.com/wireguard/conn"
|
||||||
|
|
||||||
|
// WebRTCBind is an implementation of Wireguard Bind interface backed by WebRTC data channel
|
||||||
|
type WebRTCBind struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WebRTCBind) Open(port uint16) (fns []conn.ReceiveFunc, actualPort uint16, err error) {
|
||||||
|
return nil, 0, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WebRTCBind) Close() error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WebRTCBind) SetMark(mark uint32) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WebRTCBind) Send(b []byte, ep conn.Endpoint) error {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WebRTCBind) ParseEndpoint(s string) (conn.Endpoint, error) {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// WebRTCEndpoint is an implementation of Wireguard's Endpoint interface backed by WebRTC
|
||||||
|
type WebRTCEndpoint struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*WebRTCEndpoint) ClearSrc() {
|
||||||
|
|
||||||
|
}
|
||||||
|
func (*WebRTCEndpoint) SrcToString() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
func (*WebRTCEndpoint) DstToString() string {
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
func (*WebRTCEndpoint) DstToBytes() []byte {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (*WebRTCEndpoint) DstIP() net.IP {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
func (*WebRTCEndpoint) SrcIP() net.IP {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
158
browser/main.go
158
browser/main.go
@@ -1,162 +1,18 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"fmt"
|
||||||
"github.com/wiretrustee/wiretrustee/signal/client"
|
|
||||||
"github.com/wiretrustee/wiretrustee/signal/proto"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
/* "context"
|
|
||||||
"github.com/wiretrustee/wiretrustee/signal/client"
|
|
||||||
"github.com/wiretrustee/wiretrustee/signal/proto"*/
|
|
||||||
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
||||||
"log"
|
"log"
|
||||||
"syscall/js"
|
"net/http"
|
||||||
/* "time"*/)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
log.Print("listening on http://localhost:9090")
|
||||||
|
err := http.ListenAndServe(":9090", http.FileServer(http.Dir("./assets")))
|
||||||
|
//err := http.ListenAndServe(":9090", http.FileServer(http.Dir("/home/braginini/Documents/projects/my/wiretrustee/rtctunnel/examples/browser-http/dist")))
|
||||||
|
|
||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
|
|
||||||
defer cancel()
|
|
||||||
|
|
||||||
connectToSignal := func(key wgtypes.Key, remoteKey wgtypes.Key) {
|
|
||||||
signalClient, err := client.NewWebsocketClient(ctx, "ws://localhost:80/signal", key)
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("connected to signal")
|
|
||||||
|
|
||||||
go func() {
|
|
||||||
signalClient.Receive(func(msg *proto.Message) error {
|
|
||||||
log.Printf("received a message from %v -> %v", msg.RemoteKey, msg.Body.Payload)
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
}()
|
|
||||||
|
|
||||||
time.Sleep(5 * time.Second)
|
|
||||||
|
|
||||||
log.Printf("sending msg to signal")
|
|
||||||
|
|
||||||
err = signalClient.Send(&proto.Message{
|
|
||||||
Key: key.PublicKey().String(),
|
|
||||||
RemoteKey: remoteKey.String(),
|
|
||||||
Body: &proto.Body{
|
|
||||||
Type: 0,
|
|
||||||
Payload: "hello",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
js.Global().Set("generateWireguardKey", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
|
||||||
|
|
||||||
key, err := wgtypes.GenerateKey()
|
|
||||||
if err != nil {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
js.Global().Get("document").Call("getElementById", "wgPrivateKey").Set("value", key.String())
|
|
||||||
|
|
||||||
log.Printf("Wireguard Public key %s", key.PublicKey().String())
|
|
||||||
js.Global().Get("document").Call("getElementById", "publicKey").Set("value", key.PublicKey().String())
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}))
|
|
||||||
|
|
||||||
js.Global().Set("connect", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
|
||||||
|
|
||||||
wgPrivateKey := js.Global().Get("document").Call("getElementById", "wgPrivateKey").Get("value").String()
|
|
||||||
key, err := wgtypes.ParseKey(wgPrivateKey)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
remotePublicKey := js.Global().Get("document").Call("getElementById", "peerKey").Get("value").String()
|
|
||||||
remoteKey, err := wgtypes.ParseKey(remotePublicKey)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("Remote Wireguard Public key %s", remoteKey.String())
|
|
||||||
log.Printf("Our Wireguard Public key %s", key.PublicKey().String())
|
|
||||||
go connectToSignal(key, remoteKey)
|
|
||||||
return nil
|
|
||||||
}))
|
|
||||||
|
|
||||||
select {}
|
|
||||||
|
|
||||||
/*tun, tnet, err := netstack.CreateNetTUN(
|
|
||||||
[]net.IP{net.ParseIP("10.100.0.2")},
|
|
||||||
[]net.IP{net.ParseIP("8.8.8.8")},
|
|
||||||
1420)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Panic(err)
|
fmt.Println("Failed to start server", err)
|
||||||
}
|
|
||||||
log.Println("1")
|
|
||||||
clientKey,_ := wgtypes.ParseKey("WI+uoQD9jGi+nyifmFwmswQu5r0uWFH31WeSmfU0snI=")
|
|
||||||
serverKey,_ := wgtypes.ParseKey("kLpbgt+g2+g8x556VmsLYyhTh77WmKfaFB0x+LcVyWY=")
|
|
||||||
publicServerkey := serverKey.PublicKey()
|
|
||||||
log.Println("2")*/
|
|
||||||
|
|
||||||
/*/*stunURL, err := ice.ParseURL("stun:stun.wiretrustee.com:5555")
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
agent, err := ice.NewAgent(&ice.AgentConfig{
|
|
||||||
NetworkTypes: []ice.NetworkType{ice.NetworkTypeUDP4},
|
|
||||||
Urls: []*ice.URL{stunURL},
|
|
||||||
CandidateTypes: []ice.CandidateType{ice.CandidateTypeHost, ice.CandidateTypeServerReflexive, ice.CandidateTypeRelay},
|
|
||||||
})
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/*sig, err := signal.NewClient(context.Background(), "localhost:10000", clientKey, false)
|
|
||||||
if err != nil {
|
|
||||||
log.Printf("%v", err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
sig.Receive(func(msg *proto.Message) error {
|
|
||||||
log.Printf("%v", msg)
|
|
||||||
return nil
|
|
||||||
})
|
|
||||||
|
|
||||||
sig.WaitConnected()
|
|
||||||
log.Println("3")
|
|
||||||
dev := device.NewDevice(tun, conn.NewDefaultBind(), device.NewLogger(device.LogLevelVerbose, ""))
|
|
||||||
|
|
||||||
err = dev.IpcSet(fmt.Sprintf("private_key=%s\npublic_key=%s\npersistent_keepalive_interval=5\nendpoint=65.108.52.126:50000\nallowed_ip=0.0.0.0/0",
|
|
||||||
hex.EncodeToString(clientKey[:]),
|
|
||||||
hex.EncodeToString(publicServerkey[:]),
|
|
||||||
))
|
|
||||||
log.Println("4")
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
err = dev.Up()
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
|
|
||||||
client := http.Client{
|
|
||||||
Transport: &http.Transport{
|
|
||||||
DialContext: tnet.DialContext,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
resp, err := client.Get("https://www.zx2c4.com/ip")
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
body, err := io.ReadAll(resp.Body)
|
|
||||||
if err != nil {
|
|
||||||
log.Panic(err)
|
|
||||||
}
|
|
||||||
log.Println(string(body))
|
|
||||||
time.Sleep(30 * time.Second)*/
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"log"
|
|
||||||
"net/http"
|
|
||||||
)
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
log.Print("listening on http://localhost:9090")
|
|
||||||
err := http.ListenAndServe(":9090", http.FileServer(http.Dir("/home/braginini/Documents/projects/my/wiretrustee/wiretrustee/browser/assets")))
|
|
||||||
//err := http.ListenAndServe(":9090", http.FileServer(http.Dir("/home/braginini/Documents/projects/my/wiretrustee/rtctunnel/examples/browser-http/dist")))
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
fmt.Println("Failed to start server", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
190
browser/wasm/client_js.go
Normal file
190
browser/wasm/client_js.go
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"encoding/hex"
|
||||||
|
"fmt"
|
||||||
|
"github.com/wiretrustee/wiretrustee/browser/conn"
|
||||||
|
"github.com/wiretrustee/wiretrustee/signal/client"
|
||||||
|
"github.com/wiretrustee/wiretrustee/signal/proto"
|
||||||
|
"golang.zx2c4.com/wireguard/device"
|
||||||
|
"golang.zx2c4.com/wireguard/tun/netstack"
|
||||||
|
"net"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
/* "context"
|
||||||
|
"github.com/wiretrustee/wiretrustee/signal/client"
|
||||||
|
"github.com/wiretrustee/wiretrustee/signal/proto"*/
|
||||||
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||||||
|
"log"
|
||||||
|
"syscall/js"
|
||||||
|
/* "time"*/)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
|
||||||
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Minute)
|
||||||
|
defer cancel()
|
||||||
|
|
||||||
|
connectToSignal := func(key wgtypes.Key, remoteKey wgtypes.Key) {
|
||||||
|
signalClient, err := client.NewWebsocketClient(ctx, "ws://localhost:80/signal", key)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("connected to signal")
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
signalClient.Receive(func(msg *proto.Message) error {
|
||||||
|
log.Printf("received a message from %v -> %v", msg.RemoteKey, msg.Body.Payload)
|
||||||
|
return nil
|
||||||
|
})
|
||||||
|
}()
|
||||||
|
|
||||||
|
time.Sleep(5 * time.Second)
|
||||||
|
|
||||||
|
tun, _, err := netstack.CreateNetTUN(
|
||||||
|
[]net.IP{net.ParseIP("10.100.0.2")},
|
||||||
|
[]net.IP{net.ParseIP("8.8.8.8")},
|
||||||
|
1420)
|
||||||
|
|
||||||
|
dev := device.NewDevice(tun, &conn.WebRTCBind{}, device.NewLogger(device.LogLevelVerbose, ""))
|
||||||
|
|
||||||
|
err = dev.IpcSet(fmt.Sprintf("private_key=%s\npublic_key=%s\npersistent_keepalive_interval=5\nendpoint=65.108.52.126:50000\nallowed_ip=0.0.0.0/0",
|
||||||
|
hex.EncodeToString(key[:]),
|
||||||
|
hex.EncodeToString(remoteKey[:]),
|
||||||
|
))
|
||||||
|
log.Println("4")
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
err = dev.Up()
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("device started")
|
||||||
|
|
||||||
|
/*stunURL, err := ice.ParseURL("stun:stun.wiretrustee.com:5555")
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
agent, err := ice.NewAgent(&ice.AgentConfig{
|
||||||
|
Urls: []*ice.URL{stunURL},
|
||||||
|
CandidateTypes: []ice.CandidateType{ice.CandidateTypeHost, ice.CandidateTypeServerReflexive, ice.CandidateTypeRelay},
|
||||||
|
})
|
||||||
|
|
||||||
|
fmt.Println(agent)
|
||||||
|
|
||||||
|
err = agent.OnCandidate(func(candidate ice.Candidate) {
|
||||||
|
fmt.Printf("gathered candidate %s", cancel)
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println("started gathering candidates")*/
|
||||||
|
|
||||||
|
select {}
|
||||||
|
|
||||||
|
/*log.Printf("sending msg to signal")
|
||||||
|
|
||||||
|
err = signalClient.Send(&proto.Message{
|
||||||
|
Key: key.PublicKey().String(),
|
||||||
|
RemoteKey: remoteKey.String(),
|
||||||
|
Body: &proto.Body{
|
||||||
|
Type: 0,
|
||||||
|
Payload: "hello",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}*/
|
||||||
|
}
|
||||||
|
|
||||||
|
js.Global().Set("generateWireguardKey", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||||
|
|
||||||
|
key, err := wgtypes.GenerateKey()
|
||||||
|
if err != nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
js.Global().Get("document").Call("getElementById", "wgPrivateKey").Set("value", key.String())
|
||||||
|
|
||||||
|
log.Printf("Wireguard Public key %s", key.PublicKey().String())
|
||||||
|
js.Global().Get("document").Call("getElementById", "publicKey").Set("value", key.PublicKey().String())
|
||||||
|
|
||||||
|
return nil
|
||||||
|
}))
|
||||||
|
|
||||||
|
js.Global().Set("connect", js.FuncOf(func(this js.Value, args []js.Value) interface{} {
|
||||||
|
|
||||||
|
wgPrivateKey := js.Global().Get("document").Call("getElementById", "wgPrivateKey").Get("value").String()
|
||||||
|
key, err := wgtypes.ParseKey(wgPrivateKey)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
remotePublicKey := js.Global().Get("document").Call("getElementById", "peerKey").Get("value").String()
|
||||||
|
remoteKey, err := wgtypes.ParseKey(remotePublicKey)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
log.Printf("Remote Wireguard Public key %s", remoteKey.String())
|
||||||
|
log.Printf("Our Wireguard Public key %s", key.PublicKey().String())
|
||||||
|
go connectToSignal(key, remoteKey)
|
||||||
|
return nil
|
||||||
|
}))
|
||||||
|
|
||||||
|
select {}
|
||||||
|
|
||||||
|
/*tun, tnet, err := netstack.CreateNetTUN(
|
||||||
|
[]net.IP{net.ParseIP("10.100.0.2")},
|
||||||
|
[]net.IP{net.ParseIP("8.8.8.8")},
|
||||||
|
1420)
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
log.Println("1")
|
||||||
|
clientKey,_ := wgtypes.ParseKey("WI+uoQD9jGi+nyifmFwmswQu5r0uWFH31WeSmfU0snI=")
|
||||||
|
serverKey,_ := wgtypes.ParseKey("kLpbgt+g2+g8x556VmsLYyhTh77WmKfaFB0x+LcVyWY=")
|
||||||
|
publicServerkey := serverKey.PublicKey()
|
||||||
|
log.Println("2")*/
|
||||||
|
|
||||||
|
/*/*
|
||||||
|
|
||||||
|
|
||||||
|
dev := device.NewDevice(tun, conn.NewDefaultBind(), device.NewLogger(device.LogLevelVerbose, ""))
|
||||||
|
|
||||||
|
err = dev.IpcSet(fmt.Sprintf("private_key=%s\npublic_key=%s\npersistent_keepalive_interval=5\nendpoint=65.108.52.126:50000\nallowed_ip=0.0.0.0/0",
|
||||||
|
hex.EncodeToString(clientKey[:]),
|
||||||
|
hex.EncodeToString(publicServerkey[:]),
|
||||||
|
))
|
||||||
|
log.Println("4")
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
err = dev.Up()
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
client := http.Client{
|
||||||
|
Transport: &http.Transport{
|
||||||
|
DialContext: tnet.DialContext,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
resp, err := client.Get("https://www.zx2c4.com/ip")
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
body, err := io.ReadAll(resp.Body)
|
||||||
|
if err != nil {
|
||||||
|
log.Panic(err)
|
||||||
|
}
|
||||||
|
log.Println(string(body))
|
||||||
|
time.Sleep(30 * time.Second)*/
|
||||||
|
}
|
||||||
6
go.mod
6
go.mod
@@ -6,13 +6,13 @@ require (
|
|||||||
github.com/cenkalti/backoff/v4 v4.1.0
|
github.com/cenkalti/backoff/v4 v4.1.0
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||||
github.com/golang/protobuf v1.5.2
|
github.com/golang/protobuf v1.5.2
|
||||||
github.com/google/uuid v1.2.0
|
github.com/google/uuid v1.3.0
|
||||||
github.com/gorilla/mux v1.8.0
|
github.com/gorilla/mux v1.8.0
|
||||||
github.com/gorilla/websocket v1.4.2
|
github.com/gorilla/websocket v1.4.2
|
||||||
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7
|
github.com/kardianos/service v1.2.1-0.20210728001519-a323c3813bc7
|
||||||
github.com/onsi/ginkgo v1.16.4
|
github.com/onsi/ginkgo v1.16.4
|
||||||
github.com/onsi/gomega v1.13.0
|
github.com/onsi/gomega v1.13.0
|
||||||
github.com/pion/ice/v2 v2.1.7
|
github.com/pion/ice/v2 v2.1.13
|
||||||
github.com/rs/cors v1.8.0
|
github.com/rs/cors v1.8.0
|
||||||
github.com/sirupsen/logrus v1.7.0
|
github.com/sirupsen/logrus v1.7.0
|
||||||
github.com/spf13/cobra v1.1.3
|
github.com/spf13/cobra v1.1.3
|
||||||
@@ -20,7 +20,7 @@ require (
|
|||||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519
|
||||||
golang.org/x/sys v0.0.0-20211020174200-9d6173849985
|
golang.org/x/sys v0.0.0-20211020174200-9d6173849985
|
||||||
golang.zx2c4.com/wireguard v0.0.0-20211026125340-e42c6c4bc2d0
|
golang.zx2c4.com/wireguard v0.0.0-20211026125340-e42c6c4bc2d0
|
||||||
golang.zx2c4.com/wireguard/tun/netstack v0.0.0-20211026125340-e42c6c4bc2d0 // indirect
|
golang.zx2c4.com/wireguard/tun/netstack v0.0.0-20211026125340-e42c6c4bc2d0
|
||||||
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20210803171230-4253848d036c
|
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20210803171230-4253848d036c
|
||||||
golang.zx2c4.com/wireguard/windows v0.4.5
|
golang.zx2c4.com/wireguard/windows v0.4.5
|
||||||
google.golang.org/grpc v1.39.0-dev.0.20210518002758-2713b77e8526
|
google.golang.org/grpc v1.39.0-dev.0.20210518002758-2713b77e8526
|
||||||
|
|||||||
5
go.sum
5
go.sum
@@ -341,6 +341,8 @@ github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
|
|||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
|
github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs=
|
||||||
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
|
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||||
|
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY=
|
||||||
@@ -546,6 +548,8 @@ github.com/pion/dtls/v2 v2.0.9 h1:7Ow+V++YSZQMYzggI0P9vLJz/hUFcffsfGMfT/Qy+u8=
|
|||||||
github.com/pion/dtls/v2 v2.0.9/go.mod h1:O0Wr7si/Zj5/EBFlDzDd6UtVxx25CE1r7XM7BQKYQho=
|
github.com/pion/dtls/v2 v2.0.9/go.mod h1:O0Wr7si/Zj5/EBFlDzDd6UtVxx25CE1r7XM7BQKYQho=
|
||||||
github.com/pion/ice/v2 v2.1.7 h1:FjgDfUNrVYTxQabJrkBX6ld12tvYbgzHenqPh3PJF6E=
|
github.com/pion/ice/v2 v2.1.7 h1:FjgDfUNrVYTxQabJrkBX6ld12tvYbgzHenqPh3PJF6E=
|
||||||
github.com/pion/ice/v2 v2.1.7/go.mod h1:kV4EODVD5ux2z8XncbLHIOtcXKtYXVgLVCeVqnpoeP0=
|
github.com/pion/ice/v2 v2.1.7/go.mod h1:kV4EODVD5ux2z8XncbLHIOtcXKtYXVgLVCeVqnpoeP0=
|
||||||
|
github.com/pion/ice/v2 v2.1.13 h1:/YNYcIw56LT/whwuzkTnrprcRnapj2ZNqUsR0W8elmo=
|
||||||
|
github.com/pion/ice/v2 v2.1.13/go.mod h1:ovgYHUmwYLlRvcCLI67PnQ5YGe+upXZbGgllBDG/ktU=
|
||||||
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
|
github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
|
||||||
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
|
github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
|
||||||
github.com/pion/mdns v0.0.5 h1:Q2oj/JB3NqfzY9xGZ1fPzZzK7sDSD8rZPOvcIQ10BCw=
|
github.com/pion/mdns v0.0.5 h1:Q2oj/JB3NqfzY9xGZ1fPzZzK7sDSD8rZPOvcIQ10BCw=
|
||||||
@@ -805,6 +809,7 @@ golang.org/x/net v0.0.0-20210423184538-5f58ad60dda6/go.mod h1:OJAsFXCWl8Ukc7SiCT
|
|||||||
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk=
|
||||||
golang.org/x/net v0.0.0-20210504132125-bbd867fde50d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210504132125-bbd867fde50d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
|
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI=
|
golang.org/x/net v0.0.0-20211020060615-d418f374d309 h1:A0lJIi+hcTR6aajJH4YqKWwohY4aW9RO7oRMcdv+HKI=
|
||||||
golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211020060615-d418f374d309/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
|
|||||||
Reference in New Issue
Block a user