Is your feature request related to a problem? Please describe.
My expectation to set up an environment where a tcp loadbalancer (e.g. haproxy) only binds 443 port to provide multiple services as follows:
client => haproxy => {ocserv, trojan, nginx(legit, not honeypot requests)}
I have tried serveral approaches, based on the config by ocserv's author. Ocserv works as expected. However, trojan doesn't work in a while after initial connection to the server. And I end up with this, which also works the best. This config hasn't supported nginx yet, but it shoud be working.
haproxy.cfg
frontend www-https
bind 0.0.0.0:443
mode tcp
tcp-request inspect-delay 100ms
#tcp-request content accept if { req.ssl_hello_type 1 }
default_backend bk_ssl_default
backend bk_ssl_default
mode tcp
acl ocserv-app req.ssl_sni -m end oc.exmaple.com
#acl web-app req_ssl_sni -i www.example.com
acl trojan-app req.ssl_sni -m end tj.exmaple.com
use-servmanualer server-ocserv if ocserv-app
use-server server-trojan if trojan-app
#use-server server-web if web-app
use-server server-ocserv if !ocserv-app !trojan-app #!web-app
option tcp-check
server server-ocserv 127.0.0.1:4001 send-proxy-v2 check
#server server-web 127.0.0.1:4444 check
server server-trojan 127.0.0.1:4002 check
Is this problem relevant to what trojan should care about?
I haven't read code for the relay server. But I doubt there is some "私货" in the TCP connection initialization and session reuse that potentially fail the haproxy. Or, it's just my misconfiguration.
Describe the solution you'd like
Hope trojan works as a backend in haproxy stack, by plaintext configuration.
Describe alternatives you've considered
fallback option 1:
some non-standard inspect and rewite hacks at haproxy side to support trojan.
fallback option 2:
trojan as tcp loadbalancer that inspects and redirects all traffic to backend. but it's too much for a proxy software.
Additional context
All stuff are on Linux platform.
This kind of setup-related stuff will not be put in the documentation as the documentation should be general. You are welcome to write a wiki article about it if you'd like.
Is your feature request related to a problem? Please describe. My expectation to set up an environment where a tcp loadbalancer (e.g. haproxy) only binds 443 port to provide multiple services as follows: client => haproxy => {ocserv, trojan, nginx(legit, not honeypot requests)}
I have tried serveral approaches, based on the config by ocserv's author. Ocserv works as expected. However, trojan doesn't work in a while after initial connection to the server. And I end up with this, which also works the best. This config hasn't supported nginx yet, but it shoud be working. haproxy.cfg
trojan server
trojan client:
Is this problem relevant to what trojan should care about? I haven't read code for the relay server. But I doubt there is some "私货" in the TCP connection initialization and session reuse that potentially fail the haproxy. Or, it's just my misconfiguration.
Describe the solution you'd like Hope trojan works as a backend in haproxy stack, by plaintext configuration.
Describe alternatives you've considered fallback option 1: some non-standard inspect and rewite hacks at haproxy side to support trojan. fallback option 2: trojan as tcp loadbalancer that inspects and redirects all traffic to backend. but it's too much for a proxy software.
Additional context All stuff are on Linux platform.