Skip to content
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

[Question] Is it possible to put Cloak behind some l4 proxy? #255

Open
Unb0rn opened this issue Mar 9, 2024 · 2 comments
Open

[Question] Is it possible to put Cloak behind some l4 proxy? #255

Unb0rn opened this issue Mar 9, 2024 · 2 comments

Comments

@Unb0rn
Copy link

Unb0rn commented Mar 9, 2024

I wonder if it's possible to share the outbound 443 port with other services by using something like L4 proxy with SNI (Let's say HAProxy)? Does Cloak respect proxy-protocol headers? I think neither config files nor issues have any info on it

@archer-v
Copy link

It works correctly with haproxy if it's configured as tcp-proxy (not https proxy)

Example of haproxy configuration:

frontend https_in
    bind *:443
    mode tcp
    tcp-request inspect-delay 5s
    tcp-request content accept if { req_ssl_hello_type 1 }

    # Traffic forwarding to the backend depending on the SNI
    use_backend server1 if { req_ssl_sni -i example1.com }
    use_backend server2 if { req_ssl_sni -i example2.com }

    # default backend if SNI doesn't match anyone
    default_backend cloak

backend server1
    mode tcp
    server server1 localhost:445 check

backend server2
    mode tcp
    server server2 localhost:446 check

backend cloak
    mode tcp
    server cloak localhost:444 check

There no needs of any special configuration to the cloak, just bind it on any other port, for example 444

@nordeep
Copy link

nordeep commented Aug 30, 2024

@archer-v Thank you for sharing configuration! Unfortunately in this configuration, for me, cloak doesn't redirect to RedirAddr. I couldn't find a solution. Seems SNI parsed by HAProxy and it won't send to cloak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants