QubitProducts / bamboo

HAProxy auto configuration and auto service discovery for Mesos Marathon
Apache License 2.0
794 stars 214 forks source link

Do we can support websocket feature #107

Open xiaods opened 9 years ago

xiaods commented 9 years ago

Currently we ran into a case for websocket instance. but i found it need bamboo can support is_websocket detect function, anyone interesting it?

j1n6 commented 9 years ago

I am :)

hyper0x commented 9 years ago

@activars How would you solve this issue? Have any plans?

j1n6 commented 9 years ago

There are a couple of dependent tasks in order:

  1. Multiple services in a task #30
  2. TCP loadbalalcing (adding load balancing protocol options in the UI and API, also detecting protocol if possible) #26
  3. Then we have protocol, this would help to implement websocket
hyper0x commented 9 years ago

Maybe I can do a small improvement. What about this:

Add the following two lines to 'defaults' section in haproxy template file:

option  http-server-close
timeout tunnel  3600s

I will commit a pull request, then we talk about this, OK?

j1n6 commented 9 years ago

not ideal in my opinion, I would like to preserve the existing behaviour.

hyper0x commented 9 years ago

https://github.com/QubitProducts/bamboo/pull/110

OK,it's just a try.

We will do for now, then follow your opinion & revision.

xiaods commented 9 years ago

@activars your issue have fixed right now. i don't understand the mean of "Then we have protocol, this would help to implement websocket"

j1n6 commented 9 years ago

The issues are not fixed, but they will be in the next big release. It should be possible to hack it to work with websocket at the moment. I would like to find a design in the next release to handle this in a clean way. What I meant was being able to get protocol information from Marathon (and Bamboo should be able to provide additional protocol overrides when needed).

The hack solution is setting a custom environment variable in Marathon App. You should be able write a if/else special case in template to render the template for websocket. Environment variable is available in template.

j1n6 commented 9 years ago

Here's the documentation: https://github.com/QubitProducts/bamboo#customize-haproxy-template-with-marathon-app-environment-variables

timoreimann commented 9 years ago

Does this ticket possibly also cover the issue of long-running connections (that web sockets often represent) making HAProxy restarts difficult? The two obvious solutions of either having to kill the connections or waiting potentially very long for them to complete aren't options for us.

xiaods commented 8 years ago

need send SIGTERM