-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from piaodazhu/dev
fix tunnel close bug & add a cli example
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module cli | ||
|
||
go 1.12 | ||
|
||
// require github.com/piaodazhu/proxylite v0.0.0-20230813091435-b2c8f474a9fc | ||
replace github.com/piaodazhu/proxylite => ../../ | ||
|
||
require github.com/piaodazhu/proxylite v0.0.0-00010101000000-000000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package main | ||
|
||
import ( | ||
"flag" | ||
|
||
"github.com/piaodazhu/proxylite" | ||
) | ||
|
||
func main() { | ||
var name string | ||
flag.StringVar(&name, "n", "abc", "service name") | ||
flag.Parse() | ||
cli := proxylite.NewProxyLiteClient(":9933") | ||
port, ok := cli.AnyPort() | ||
if !ok { | ||
panic("anyport() error") | ||
} | ||
_, done, err := cli.RegisterInnerService(proxylite.RegisterInfo{ | ||
OuterPort: port, | ||
InnerAddr: ":123", | ||
Name: name, | ||
Message: "hello world", | ||
}, proxylite.ControlInfo{}) | ||
if err != nil { | ||
panic(err) | ||
} | ||
<-done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters