Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into turn
  • Loading branch information
kylecarbs committed Apr 17, 2022
commit 54d5a59cc3c9cf1add13010719b5d38e5bbcdb4f
2 changes: 1 addition & 1 deletion cli/gitssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestGitSSH(t *testing.T) {
coderdtest.AwaitWorkspaceAgents(t, client, workspace.LatestBuild.ID)
resources, err := client.WorkspaceResourcesByBuild(context.Background(), workspace.LatestBuild.ID)
require.NoError(t, err)
dialer, err := client.DialWorkspaceAgent(ctx, resources[0].Agents[0].ID, nil)
dialer, err := client.DialWorkspaceAgent(context.Background(), resources[0].Agents[0].ID, nil)
require.NoError(t, err)
defer dialer.Close()
_, err = dialer.Ping()
Expand Down
29 changes: 2 additions & 27 deletions coderd/turnconn/turnconn.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package turnconn

import (
"fmt"
"io"
"net"
"sync"
Expand Down Expand Up @@ -37,33 +36,9 @@ var (
// The relay address is used to broadcast the location of an accepted connection.
func New(relayAddress *turn.RelayAddressGeneratorStatic) (*Server, error) {
if relayAddress == nil {
ip := ""
addrs, err := net.InterfaceAddrs()
if err != nil {
return nil, xerrors.Errorf("find interface addrs: %w", err)
}
// Try to find the localhost IP address.
// It will generally be 127.0.0.1, but
// search to be sure!
for _, address := range addrs {
ipNet, ok := address.(*net.IPNet)
if !ok {
continue
}
if !ipNet.IP.IsLoopback() {
continue
}
ip = ipNet.IP.String()
break
}
fmt.Printf("WE HAVE IP %q\n", ip)
// if ip == "" {
ip = "127.0.0.1"
// }

relayAddress = &turn.RelayAddressGeneratorStatic{
RelayAddress: net.ParseIP(ip),
Address: ip,
RelayAddress: localhost.IP,
Address: "127.0.0.1",
}
}
logger := logging.NewDefaultLoggerFactory()
Expand Down
16 changes: 2 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ require (
github.com/pion/datachannel v1.5.2
github.com/pion/logging v0.2.2
github.com/pion/transport v0.13.0
github.com/pion/turn/v2 v2.0.8
github.com/pion/webrtc/v3 v3.1.28
github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8
github.com/pkg/sftp v1.13.4
Expand All @@ -97,6 +98,7 @@ require (
golang.org/x/crypto v0.0.0-20220315160706-3147a52a75dd
golang.org/x/exp v0.0.0-20220414153411-bcd21879b8fd
golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd
golang.org/x/oauth2 v0.0.0-20220309155454-6242fa91716a
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220328115105-d36c6a25d886
Expand All @@ -109,20 +111,6 @@ require (
storj.io/drpc v0.0.30
)

require (
github.com/cloudflare/cloudflared v0.0.0-00010101000000-000000000000
github.com/open-policy-agent/opa v0.39.0
github.com/pion/turn/v2 v2.0.8
golang.org/x/net v0.0.0-20220401154927-543a649e0bdd
)

require (
github.com/OneOfOne/xxhash v1.2.8 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/rcrowley/go-metrics v0.0.0-20200313005456-10cdbea86bc0 // indirect
github.com/yashtewari/glob-intersection v0.1.0 // indirect
)

require (
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 // indirect
github.com/Azure/go-ntlmssp v0.0.0-20200615164410-66371956d46c // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1102,8 +1102,6 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/ktrysmt/go-bitbucket v0.6.4/go.mod h1:9u0v3hsd2rqCHRIpbir1oP7F58uo5dq19sBYvuMoyQ4=
github.com/kylecarbs/cloudflared v0.0.0-20220323202451-083379ce31c3 h1:JopBWZaVmN4tqWlOb/cEv5oGcL/TUE5gdI4g0yCOyh0=
github.com/kylecarbs/cloudflared v0.0.0-20220323202451-083379ce31c3/go.mod h1:4chGYq3uDzeHSpht2LFNZc/8ulHhMW9MvHPvzT5aZx8=
github.com/kylecarbs/ice/v2 v2.1.8-0.20220414143940-b5b2f89c4a4f h1:y6JzBYK3+bN5+l1ZXPu5ns91KgbnQojFaDdvwY5N3G8=
github.com/kylecarbs/ice/v2 v2.1.8-0.20220414143940-b5b2f89c4a4f/go.mod h1:SWuHiOGP17lGromHTFadUe1EuPgFh/oCU6FCMZHooVE=
github.com/kylecarbs/opencensus-go v0.23.1-0.20220307014935-4d0325a68f8b h1:1Y1X6aR78kMEQE1iCjQodB3lA7VO4jB88Wf8ZrzXSsA=
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.