重新组织目录结构
This commit is contained in:
parent
fc214b2c72
commit
54cd925ab2
|
|
@ -2,6 +2,7 @@ package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
llog "github.com/TransX/log"
|
llog "github.com/TransX/log"
|
||||||
|
"github.com/TransX/protocol"
|
||||||
"github.com/davecheney/profile"
|
"github.com/davecheney/profile"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
|
|
@ -15,12 +16,12 @@ var mux sync.Mutex
|
||||||
var benchSeed int
|
var benchSeed int
|
||||||
|
|
||||||
func transClient() {
|
func transClient() {
|
||||||
t := NewTransTCP()
|
t := protocol.NewTransTCP()
|
||||||
t.Start("1200", "127.0.0.1", "1201", "client")
|
t.Start("1200", "127.0.0.1", "1201", "client")
|
||||||
}
|
}
|
||||||
|
|
||||||
func transServer() {
|
func transServer() {
|
||||||
t := NewTransTCP()
|
t := protocol.NewTransTCP()
|
||||||
t.Start("1201", "192.168.56.101", "80", "server")
|
t.Start("1201", "192.168.56.101", "80", "server")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
5
main.go
5
main.go
|
|
@ -6,12 +6,13 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/TransX/cli"
|
"github.com/TransX/cli"
|
||||||
"github.com/TransX/log"
|
"github.com/TransX/log"
|
||||||
|
"github.com/TransX/protocol"
|
||||||
"github.com/davecheney/profile"
|
"github.com/davecheney/profile"
|
||||||
"strconv"
|
"strconv"
|
||||||
)
|
)
|
||||||
|
|
||||||
func tunnel() {
|
func tunnel() {
|
||||||
trans := NewTransTCP()
|
trans := protocol.NewTransTCP()
|
||||||
log.Info("%s side is encrypted.", cli.EncryptSide)
|
log.Info("%s side is encrypted.", cli.EncryptSide)
|
||||||
if cli.DestPort != 0 {
|
if cli.DestPort != 0 {
|
||||||
log.Info("Listening on 0.0.0.0:%d. Forward %s:%d", cli.ListenPort, cli.DestIP, cli.DestPort)
|
log.Info("Listening on 0.0.0.0:%d. Forward %s:%d", cli.ListenPort, cli.DestIP, cli.DestPort)
|
||||||
|
|
@ -22,7 +23,7 @@ func tunnel() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main1() {
|
||||||
defer profile.Start(profile.CPUProfile).Stop()
|
defer profile.Start(profile.CPUProfile).Stop()
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
fmt.Println("Hello World!")
|
fmt.Println("Hello World!")
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package protocol
|
||||||
|
|
||||||
type Direction int
|
type Direction int
|
||||||
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package protocol
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
package main
|
package protocol
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
Loading…
Reference in New Issue