-
Notifications
You must be signed in to change notification settings - Fork 501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] TCP proxy supporting #229
Comments
@jxd134 @siaron |
(1) we should seperate tcp/udp proxy with httpserver. |
|
Yes, here is an Easegress development guide. |
We have to discuss the spec first. Let me think of an example for this feature. kind: TCPServer
name: server-demo
port: 10080
rules:
backend: tcp-demo
---
name: tcp-demo
kind: TCPPipeline
flow:
- filter: proxy
filters:
- name: proxy
kind: TCPProxy
mainPool:
servers:
- url: tcp://127.0.0.1:9095
- url: tcp://127.0.0.1:9096
- url: tcp://127.0.0.1:9097 Or, even we can have TCP servers behind HTTPServer, like kind: HTTPServer
name: server-demo
port: 10080
keepAlive: true
https: false
rules:
- paths:
- pathPrefix: /pipeline
backend: tcp-demo
---
name: tcp-demo
kind: TCPPipeline
flow:
- filter: proxy
filters:
- name: proxy
kind: TCPProxy
mainPool:
servers:
- url: tcp://127.0.0.1:9095
- url: tcp://127.0.0.1:9096
- url: tcp://127.0.0.1:9097 |
@nevill My implementation tends to be the second. The handler I designed is as follows(like netty): type (
// Layer4Handler is the common handler for the all backends
// which handle the traffic from layer4(tcp/udp) server.
Layer4Handler interface {
InboundHandler(ctx context.Layer4Context, object interface{})
OutboundHandler(ctx context.Layer4Context, object interface{})
}
// Layer4MuxMapper gets layer4 handler pipeline with mutex
Layer4MuxMapper interface {
GetHandler(name string) (Layer4Handler, bool)
}
) |
We will hold the 4-layer traffic support until imminent requirement. |
Background
Requirement
Discussion
Question 1: Which kind of instance should this feature belong to?
TafficGate
for specified application protocols, such asHTTP
,MQTT
, andWebSocket
.TrafficController
, which manages HTTP-protocol-basedHTTPServer
andPipeline
by namespace.Question 2: Are there some awesome, open-sourced packages can we directly import?
Question 3: How many basic features should a TCP proxy supported?
NewLimitListener
inEasegress
's util pkg?Question 4: Should we introduce these advanced features in the future?
.....
Summary
Version 1
conclusion for thisTCPProxy
, PR for this implementation is also welcomed!References
The text was updated successfully, but these errors were encountered: