feature: Refactors backend runtime's communication mechanism to be more stable.
This commit is contained in:
parent
93f2f9cbee
commit
1e1a330a4b
10 changed files with 254 additions and 157 deletions
|
@ -100,15 +100,13 @@ func StartProxy(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
backend.RuntimeCommands <- &commonbackend.AddProxy{
|
||||
backendResponse, err := backend.ProcessCommand(&commonbackend.AddProxy{
|
||||
Type: "addProxy",
|
||||
SourceIP: proxy.SourceIP,
|
||||
SourcePort: proxy.SourcePort,
|
||||
DestPort: proxy.DestinationPort,
|
||||
Protocol: proxy.Protocol,
|
||||
}
|
||||
|
||||
backendResponse := <-backend.RuntimeCommands
|
||||
})
|
||||
|
||||
switch responseMessage := backendResponse.(type) {
|
||||
case error:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue