Skip to content

Commit

Permalink
Allow using a different address with the -addr flag (#4)
Browse files Browse the repository at this point in the history
By default the server runs on port `8105`, the flag `-addr` can be used
to change that.
  • Loading branch information
kalbasit authored Nov 19, 2024
1 parent 20af42c commit 3a9120d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ import (
"github.com/kalbasit/signal-api-receiver/server"
)

var addr string
var signalApiURL string
var signalAccount string

func init() {
flag.StringVar(&addr, "addr", ":8105", "The address to listen and serve on")
flag.StringVar(&signalApiURL, "signal-api-url", "", "The URL of the Signal api including the scheme. e.g wss://signal-api.example.com")
flag.StringVar(&signalAccount, "signal-account", "", "The account number for signal")
}
Expand Down Expand Up @@ -48,5 +50,5 @@ func main() {
srv := server.New(sarc)

log.Print("Starting HTTP server on :8105")
http.ListenAndServe(":8105", srv)
http.ListenAndServe(addr, srv)
}

0 comments on commit 3a9120d

Please sign in to comment.