Skip to content

Commit

Permalink
add TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
piaodazhu committed Aug 13, 2023
1 parent fd5a6d4 commit 422a879
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ So why not write a package to make this more elegant? proxylite was born. Its ma
1. Easy to integrate into code. Both server and client structures are provided. Just import this package then register tunnels whenever you want.
2. Dynamic on-demand reverse proxy. **One registration, one port, one user, one tcp connection.**
3. Service registration and discovery.
4. Customized hooks are support.
4. Customized hooks are support. (Under development)

## Concepts
```
Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
1. 易于集成到代码中。提供了服务器和客户端结构。只需导入此包,然后在需要时注册隧道。
2. 动态按需反向代理。**一次注册,一个端口,一个用户,一个 TCP 连接。**
3. 服务注册和发现。
4. 支持自定义钩子。
4. 支持自定义钩子。(开发中)

## 概念
```
Expand Down
4 changes: 4 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- [ ] Hook API
- [ ] Unit Tests
- [ ] Code Report
- [ ] Benchmark
1 change: 1 addition & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type RegisterEntry struct {
Done <-chan struct{}
}

// ProxyLiteClient inner client that forwards traffic between inner service and proxy server server.
type ProxyLiteClient struct {
ready bool
serverAddr string
Expand Down
8 changes: 8 additions & 0 deletions protocol.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,23 @@ const (
TypeRegisterServiceRsp
)

// AskFreePortReq Ask avaliable free ports request
type AskFreePortReq struct{}

// AskFreePortRsp Ask avaliable free ports response
type AskFreePortRsp struct {
Ports []int
}

// RegisterInfo Register information
type RegisterInfo struct {
OuterPort int
InnerAddr string
Name string
Message string
}

// RegisterServiceReq inner service registration request
type RegisterServiceReq struct {
Info RegisterInfo
}
Expand All @@ -41,14 +45,17 @@ const (
RegisterRspServerError
)

// RegisterServiceRsp inner service registration response
type RegisterServiceRsp struct {
Code int
}

// AskServiceReq Service discovery request
type AskServiceReq struct {
Prefix string
}

// ServiceInfo Service basic information
type ServiceInfo struct {
Port int
Name string
Expand All @@ -57,6 +64,7 @@ type ServiceInfo struct {
Birth time.Time
}

// AskServiceRsp Service discovery response
type AskServiceRsp struct {
Services []ServiceInfo
}
Expand Down
4 changes: 4 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
Package proxylite is a dynamic reverse proxy package for Go.
*/
package proxylite

import (
Expand All @@ -20,6 +23,7 @@ type tunnel struct {
info *RegisterInfo
}

// ProxyLiteServer Public server that forwards traffic between user and inner client.
type ProxyLiteServer struct {
all map[int]struct{}
lock sync.RWMutex
Expand Down

0 comments on commit 422a879

Please sign in to comment.