fix windows thing
This commit is contained in:
78
Makefile
78
Makefile
@ -1,7 +1,11 @@
|
||||
|
||||
GO_COMPILER_OPTS = -a -tags netgo -ldflags '-w -extldflags "-static"'
|
||||
|
||||
all: fmt win lin linarm mac
|
||||
httpall: fmt win lin linarm mac
|
||||
|
||||
opall: fmt opwin oplin oplinarm opmac
|
||||
|
||||
all: httpall opall
|
||||
|
||||
fmt:
|
||||
gofmt -w *.go */*.go
|
||||
@ -85,4 +89,74 @@ vet:
|
||||
go vet ./windows/*.go
|
||||
|
||||
clean:
|
||||
rm -f httpproxy-* *.exe *.log
|
||||
rm -f httpproxy-* outproxy-* *.exe *.log *.js *.map
|
||||
|
||||
opwin: opwin32 opwin64
|
||||
|
||||
opwin64:
|
||||
GOOS=windows GOARCH=amd64 go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-buildmode=exe \
|
||||
-o ./outproxy.exe \
|
||||
./outproxy/windows/main.go
|
||||
@echo "built"
|
||||
|
||||
opwin32:
|
||||
GOOS=windows GOARCH=386 go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-buildmode=exe \
|
||||
-o ./outproxy.exe \
|
||||
./outproxy/windows/main.go
|
||||
@echo "built"
|
||||
|
||||
oplin: oplin64 oplin32
|
||||
|
||||
oplin64:
|
||||
GOOS=linux GOARCH=amd64 go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-o ./outproxy-64 \
|
||||
./outproxy/cmd/main.go
|
||||
@echo "built"
|
||||
|
||||
oplin32:
|
||||
GOOS=linux GOARCH=386 go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-buildmode=exe \
|
||||
-o ./outproxy-32 \
|
||||
./outproxy/cmd/main.go
|
||||
@echo "built"
|
||||
|
||||
oplinarm: oplinarm32 oplinarm64
|
||||
|
||||
oplinarm64:
|
||||
GOOS=linux GOARCH=arm64 go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-buildmode=exe \
|
||||
-o ./outproxy-arm64 \
|
||||
./outproxy/cmd/main.go
|
||||
@echo "built"
|
||||
|
||||
oplinarm32:
|
||||
GOOS=linux GOARCH=arm go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-buildmode=exe \
|
||||
-o ./outproxy-arm32 \
|
||||
./outproxy/cmd/main.go
|
||||
@echo "built"
|
||||
|
||||
|
||||
opmac: opmac32 opmac64
|
||||
|
||||
opmac64:
|
||||
GOOS=darwin GOARCH=amd64 go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-o ./outproxy-64.app \
|
||||
./outproxy/cmd/main.go
|
||||
@echo "built"
|
||||
|
||||
opmac32:
|
||||
GOOS=darwin GOARCH=amd64 go build \
|
||||
$(GO_COMPILER_OPTS) \
|
||||
-o ./outproxy-32.app \
|
||||
./outproxy/cmd/main.go
|
||||
@echo "built"
|
||||
|
@ -22,12 +22,16 @@ func NewSAMHTTPController(profiles []string, proxy *http.Server) (*SAMHTTPContro
|
||||
c.ProxyServer = proxy
|
||||
}
|
||||
for index, profile := range profiles {
|
||||
if bytes, err := ioutil.ReadFile(profile); err == nil {
|
||||
log.Println("Monitoring Firefox Profile", index, "at:", profile)
|
||||
c.Profiles = append(c.Profiles, profile)
|
||||
c.savedProfiles = append(c.savedProfiles, string(bytes))
|
||||
} else {
|
||||
return nil, err
|
||||
if profile != "" {
|
||||
if bytes, err := ioutil.ReadFile(profile); err == nil {
|
||||
if string(bytes) != "" {
|
||||
log.Println("Monitoring Firefox Profile", index, "at:", profile)
|
||||
c.Profiles = append(c.Profiles, profile)
|
||||
c.savedProfiles = append(c.savedProfiles, string(bytes))
|
||||
}
|
||||
} else {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
}
|
||||
return &c, nil
|
||||
|
@ -19,8 +19,8 @@ var (
|
||||
proxHostString = flag.String("proxy-host", "127.0.0.1", "host: of the HTTP proxy")
|
||||
proxPortString = flag.String("proxy-port", "7950", ":port of the HTTP proxy")
|
||||
controlHostString = flag.String("control-host", "127.0.0.1", "The host of the controller")
|
||||
controlPortString = flag.String("control-host", "7951", "The port of the controller")
|
||||
watchProfiles = flag.String("watch-profiles", "~/.mozilla/.firefox.profile.i2p.default/user.js,~/.mozilla/.firefox.profile.i2p.debug/user.js", "Monitor and control these Firefox profiles")
|
||||
controlPortString = flag.String("control-port", "7951", "The port of the controller")
|
||||
watchProfiles = flag.String("watch-profiles", "", "Monitor and control these Firefox profiles")
|
||||
debugConnection = flag.Bool("conn-debug", false, "Print connection debug info")
|
||||
inboundTunnelLength = flag.Int("in-tun-length", 3, "Tunnel Length(default 3)")
|
||||
outboundTunnelLength = flag.Int("out-tun-length", 3, "Tunnel Length(default 3)")
|
||||
|
Reference in New Issue
Block a user