Problem
Description
Slim currently only supports HTTP/HTTPS protocols with WebSocket support. This feature request aims to extend Slim's capabilities to include generic TCP and UDP proxying, making it a more versatile local development tool.
Current State
Slim is designed as an HTTP/HTTPS reverse proxy for local development . It supports:
- HTTP/HTTPS with automatic redirects
- HTTP/2.
- WebSocket via HTTP upgrade
- TCP as underlying transport only
Technical Considerations
- Architecture: Need to extend
proxy.Server struct to handle TCP/UDP listeners
- Port Forwarding: Current iptables/pfctl rules only handle TCP
- Certificate Management: TLS certificates not needed for raw TCP/UDP
- Logging: Extend access logging for TCP/UDP connections
Use Cases
- Database proxying (MySQL, PostgreSQL on TCP)
- DNS server development (UDP)
- Game server development (UDP)
- Microservices with non-HTTP protocols
Proposed Solution
1. TCP Proxy Support
- Add TCP listener alongside existing HTTP servers
- Implement raw TCP connection forwarding
- Extend configuration to support TCP routes
- Modify port forwarding rules to handle arbitrary TCP ports
2. UDP Proxy Support
- Add UDP packet forwarding capabilities
- Implement UDP connection tracking for stateless proxying
- Handle UDP-specific challenges (connection tracking, timeouts)
3. Configuration Extension
Extend .slim.yaml to support:
domains:
- domain: myapp
port: 3000
tcp_routes:
- port: 3306
target: localhost:3307
udp_routes:
- port: 53
target: localhost:8053
Alternatives Considered
No response
Problem
Description
Slim currently only supports HTTP/HTTPS protocols with WebSocket support. This feature request aims to extend Slim's capabilities to include generic TCP and UDP proxying, making it a more versatile local development tool.
Current State
Slim is designed as an HTTP/HTTPS reverse proxy for local development . It supports:
Technical Considerations
proxy.Serverstruct to handle TCP/UDP listenersUse Cases
Proposed Solution
1. TCP Proxy Support
2. UDP Proxy Support
3. Configuration Extension
Extend
.slim.yamlto support:Alternatives Considered
No response