Surely transpiling Go to Javascript can't possibly be that simple?
This commit is contained in:
12
Makefile
12
Makefile
@ -15,6 +15,7 @@ echo:
|
||||
@echo "$(GOPATH)"
|
||||
find . -path ./.go -prune -o -name "*.go" -exec gofmt -w {} \;
|
||||
find . -path ./.go -prune -o -name "*.i2pkeys" -exec rm {} \;
|
||||
find . -path ./.go -prune -o -name "*.go" -exec cat {} \; | nl
|
||||
|
||||
test: test-ntcp test-ssu test-config test-manager
|
||||
|
||||
@ -243,3 +244,14 @@ visit:
|
||||
|
||||
forward:
|
||||
./bin/ephsite -client -dest i2p-projekt.i2p
|
||||
|
||||
gojs:
|
||||
go get -u github.com/gopherjs/gopherjs
|
||||
|
||||
GOPHERJS=$(GOPATH)/bin/gopherjs
|
||||
|
||||
js:
|
||||
mkdir -p bin
|
||||
$(GOPHERJS) build -v --tags netgo \
|
||||
-o ./bin/$(samcatd).js \
|
||||
./daemon/*.go
|
||||
|
@ -127,12 +127,12 @@ Donate
|
||||
BTC:159M8MEUwhTzE9RXmcZxtigKaEjgfwRbHt
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAEBCgAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAlxHleQACgkQ11wDs5te
|
||||
FOEXEwf9HRs1h27cwE8VqH2iOCXuzED6ShPWY6HX5zc6lWaYwWqoP0254RUKjQa5
|
||||
8ZcTKs+H/AIxzDrlRj4L9TBlyoG1bQsrTbJ42RIJsY0yj02YQEe0M1cH6zvf5zwr
|
||||
Pee8HXpZV4hEx7KMd33yQGyvZ35FGNvxGrp6LaUYb/SR/BJ8plB8a4QGqPZEPi60
|
||||
6Xz3hafunpjo8pi4lpnVOvFxfAjq2n7dmPFfwxPHxEL6q9srwN9XzfpIg9C30diF
|
||||
ncoqUj81LaDejWSOtJBv99Kxj3PcsS3JSdPMTPkdAy5kaAdauX3wlGI+i1CdKBoV
|
||||
eVV7h7wRPaPzPkdaBKPJZbQhP3UEqQ==
|
||||
=pqBI
|
||||
iQEzBAEBCgAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAlxNM2MACgkQ11wDs5te
|
||||
FOGJRAf+Py2OGrMaDq1OiyApyg3/50A+sfgji9sHPWRbS1Go5jKMtpVkDNKcJz03
|
||||
xsIJEmXe4ZQ8yQHxfgynTTHUg7b5TBJQw4dk5V+kZjIZjLzLDSOapU4j+gVcXpKJ
|
||||
tSTA/JFFtjeXOq/0lHC3KwLa+RLNHLUKIoQHWMkIdmNJoEdg0YDNtcuZcAZJxwp2
|
||||
WjDEBKnlACUVUNYEafpgohwBb3VLlBCWZ29gPqP+70hhoBNKKwyn+896XtscmrdD
|
||||
wiCsKOafsOATO0zopUL6Icocswh8uwuiih0JZCaCuR8RVhAviP/XLKXFORWubsez
|
||||
687rN7iBEz41uDmJ34CHEmM2J0TXew==
|
||||
=nDia
|
||||
-----END PGP SIGNATURE-----
|
||||
|
@ -8,7 +8,7 @@ import (
|
||||
//Option is a SAMForwarder Option
|
||||
type Option func(*SAMForwarder) error
|
||||
|
||||
//SetFilePath sets the host of the SAMForwarder's SAM bridge
|
||||
//SetFilePath sets the path to save the config file at.
|
||||
func SetFilePath(s string) func(*SAMForwarder) error {
|
||||
return func(c *SAMForwarder) error {
|
||||
c.FilePath = s
|
||||
@ -37,7 +37,7 @@ func SetSaveFile(b bool) func(*SAMForwarder) error {
|
||||
}
|
||||
}
|
||||
|
||||
//SetHost sets the host of the SAMForwarder's SAM bridge
|
||||
//SetHost sets the host of the service to forward
|
||||
func SetHost(s string) func(*SAMForwarder) error {
|
||||
return func(c *SAMForwarder) error {
|
||||
c.TargetHost = s
|
||||
@ -45,7 +45,7 @@ func SetHost(s string) func(*SAMForwarder) error {
|
||||
}
|
||||
}
|
||||
|
||||
//SetPort sets the port of the SAMForwarder's SAM bridge using a string
|
||||
//SetPort sets the port of the service to forward
|
||||
func SetPort(s string) func(*SAMForwarder) error {
|
||||
return func(c *SAMForwarder) error {
|
||||
port, err := strconv.Atoi(s)
|
||||
|
@ -278,8 +278,6 @@ func (f SAMForwarder) forward(conn *sam3.SAMConn) { //(conn net.Conn) {
|
||||
} else {
|
||||
log.Println("Error: ", requestbytes, err)
|
||||
}
|
||||
//f.clientUnlockAndClose(true, false, client)
|
||||
//f.connUnlockAndClose(false, true, conn)
|
||||
} else {
|
||||
defer client.Close()
|
||||
defer conn.Close()
|
||||
@ -296,8 +294,6 @@ func (f SAMForwarder) forward(conn *sam3.SAMConn) { //(conn net.Conn) {
|
||||
} else {
|
||||
log.Println("Response Error: ", responsebytes, err)
|
||||
}
|
||||
//f.clientUnlockAndClose(false, true, client)
|
||||
//f.connUnlockAndClose(true, false, conn)
|
||||
} else {
|
||||
defer client.Close()
|
||||
defer conn.Close()
|
||||
|
Reference in New Issue
Block a user