Skip to content

Commit

Permalink
fix: proxysip example
Browse files Browse the repository at this point in the history
  • Loading branch information
emiago committed Feb 9, 2024
1 parent 6a06e82 commit 596d30d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
6 changes: 4 additions & 2 deletions example/proxysip/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ version: "2.4"
services:
proxy:
image: golang:latest
command: go run ./example/proxysip -ip=10.5.0.20:5060 -dst 10.5.0.30:5060
command: go run . -ip=10.5.0.20:5060 -dst 10.5.0.30:5060
# stdin_open: true
# command: bash
working_dir: /usr/src/sipgo
working_dir: /usr/src/sipgo/example/proxysip
volumes:
- ../../../sipgo:/usr/src/sipgo

Expand All @@ -25,6 +25,8 @@ services:
# - GODEBUG=madvdontneed=0
# - GODEBUG=madvdontneed=1,gctrace=1
# - GOGC=70
ports:
- 8080:8080

uas:
image: ctaloi/sipp
Expand Down
2 changes: 2 additions & 0 deletions example/proxysip/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
)

require (
github.com/arl/statsviz v0.6.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -21,6 +22,7 @@ require (
github.com/gobwas/ws v1.2.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
github.com/icholy/digest v0.1.22 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
Expand Down
4 changes: 4 additions & 0 deletions example/proxysip/go.sum
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
github.com/arl/statsviz v0.6.0 h1:jbW1QJkEYQkufd//4NDYRSNBpwJNrdzPahF7ZmoGdyE=
github.com/arl/statsviz v0.6.0/go.mod h1:0toboo+YGSUXDaS4g1D5TVS4dXs7S7YYT5J/qnW2h8s=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44=
Expand All @@ -24,6 +26,8 @@ github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
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/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
github.com/icholy/digest v0.1.22 h1:dRIwCjtAcXch57ei+F0HSb5hmprL873+q7PoVojdMzM=
github.com/icholy/digest v0.1.22/go.mod h1:uLAeDdWKIWNFMH0wqbwchbTQOmJWhzSnL7zmqSPqEEc=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
Expand Down
2 changes: 2 additions & 0 deletions example/proxysip/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strconv"
"time"

"github.com/arl/statsviz"
"github.com/emiago/sipgo/sip"

_ "net/http/pprof"
Expand Down Expand Up @@ -78,6 +79,7 @@ func httpServer(address string) {
w.WriteHeader(200)
w.Write(data)
})
statsviz.Register(http.DefaultServeMux)

log.Info().Msgf("Http server started address=%s", address)
http.ListenAndServe(address, nil)
Expand Down

0 comments on commit 596d30d

Please sign in to comment.