Skip to content

Commit fcf92ec

Browse files
committed
Merge pull request #1 from shazow/master
Minor improvements: host flag, make example
2 parents fe2ac76 + 65303f2 commit fcf92ec

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
build: execd
2+
go build .
13

2-
build:
3-
go build .
4+
example: build
5+
./execd -h localhost -p 2022 -k example/host_pk.pem example/authcheck example/helloworld

execd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"github.com/flynn/go-shlex"
2323
)
2424

25+
var host = flag.String("h", "", "host ip to listen on")
2526
var port = flag.String("p", "22", "port to listen on")
2627
var debug = flag.Bool("d", false, "debug mode displays handler output")
2728
var env = flag.Bool("e", false, "pass environment to handlers")
@@ -206,7 +207,7 @@ func main() {
206207
if p := os.Getenv("PORT"); p != "" && *port == "22" {
207208
*port = p
208209
}
209-
listener, err := net.Listen("tcp", ":"+*port)
210+
listener, err := net.Listen("tcp", *host+":"+*port)
210211
if err != nil {
211212
log.Fatalln("Failed to listen for connections:", err)
212213
}

0 commit comments

Comments
 (0)