https://github.com/shanghaobo/go-http-forward
Go通过socket实现http转发
https://github.com/shanghaobo/go-http-forward
forward gin go http socket
Last synced: 2 months ago
JSON representation
Go通过socket实现http转发
- Host: GitHub
- URL: https://github.com/shanghaobo/go-http-forward
- Owner: shanghaobo
- Created: 2023-09-01T06:52:25.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2023-09-14T05:41:50.000Z (almost 3 years ago)
- Last Synced: 2025-07-19T14:58:51.532Z (11 months ago)
- Topics: forward, gin, go, http, socket
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# go-http-forward
> go实现的通过socket转发http的功能
### 使用示例
```go
package main
import (
"github.com/shanghaobo/go-http-forward/client"
"github.com/shanghaobo/go-http-forward/server"
"sync"
)
func main() {
wg := sync.WaitGroup{}
wg.Add(2)
//启动客户端
go func() {
defer wg.Done()
client.Start("127.0.0.1", "9919", "12333", "http://127.0.0.1:19000/api/toast")
}()
//启动服务端
go func() {
defer wg.Done()
server.Start("9919", "12333", "111", "19009")
}()
wg.Wait()
}
```