Skip to content

Commit

Permalink
Try changing the url to ipv4
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay committed Dec 1, 2023
1 parent 408267a commit 90c7417
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions internal/deploy/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"sync"
"testing"
"time"
Expand Down Expand Up @@ -172,31 +173,6 @@ func RunNewDeployment(t *testing.T, shouldTCPDump bool) *SlidingSyncDeployment {
rpHS1URL := externalURL(t, mitmproxyContainer, hs1ExposedPort)
rpHS2URL := externalURL(t, mitmproxyContainer, hs2ExposedPort)
controllerURL := externalURL(t, mitmproxyContainer, controllerExposedPort)
time.Sleep(time.Second)
execInContainer := func(c testcontainers.Container, cmd []string) {
_, r, err := c.Exec(context.Background(), cmd)
if err != nil {
panic(err)
}
output, err := io.ReadAll(r)
if err != nil {
panic(err)
}
fmt.Println(string(output))
}
execInContainer(mitmproxyContainer, []string{
"apt", "update",
})
execInContainer(mitmproxyContainer, []string{
"apt", "install", "net-tools", "curl", "-y",
})
execInContainer(mitmproxyContainer, []string{
"netstat", "-lp",
})
execInContainer(mitmproxyContainer, []string{
"curl", "-v", "-X", "POST", "-d", "{}", "-x", "http://localhost:8080", "http://mitm.code/options/unlock",
})
fmt.Println("____________________________")

// Make a postgres container
postgresContainer, err := testcontainers.GenericContainer(context.Background(), testcontainers.GenericContainerRequest{
Expand Down Expand Up @@ -271,6 +247,7 @@ func RunNewDeployment(t *testing.T, shouldTCPDump bool) *SlidingSyncDeployment {
// TODO needs sudo
t.Logf("Started tcpdumping: PID %d", cmd.Process.Pid)
}
controllerURL = strings.Replace(controllerURL, "localhost", "127.0.0.1", 1)
proxyURL, err := url.Parse(controllerURL)
must.NotError(t, "failed to parse controller URL", err)
t.Logf("mitm proxy url => %s", proxyURL.String())
Expand Down

0 comments on commit 90c7417

Please sign in to comment.