重新组织目录结构

This commit is contained in:
dmy@lab 2015-11-18 23:16:57 +08:00
parent fc214b2c72
commit 54cd925ab2
5 changed files with 9 additions and 7 deletions

View File

@ -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")
} }

View File

@ -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!")

View File

@ -1,4 +1,4 @@
package main package protocol
type Direction int type Direction int

View File

@ -1,4 +1,4 @@
package main package protocol
import ( import (
"errors" "errors"

View File

@ -1,4 +1,4 @@
package main package protocol
import ( import (
"bytes" "bytes"