[erlang-questions] Switching between http/non-http depending of first byte

Rapsey rapsey@REDACTED
Thu Oct 1 10:45:46 CEST 2009


I've thought about the same thing for my streaming server. But I didn't
decide to do it that way.
Are you sure you want to put RTMP and HTTP on port 80? It means you'll be
running your Erlang server as root, which is not exactly safe. It also means
load balancers/reverse proxies, software or hardware based are not going to
work.
This is why RTMPT was invented (http tunneling for RTMP).

Also do you need a full blown web server like yaws or mochiweb? It may be
easier to just implement the HTTP features you need manually. It's pretty
easy to do in Erlang and It's what I did.


Sergej


On Thu, Oct 1, 2009 at 9:50 AM, Max Lapshin <max.lapshin@REDACTED> wrote:

> Hi. I want to implement an unusual feature: when server accepts socket,
> it must look at first byte. If it is 0x03, than I want to handle it by
> one handler (RTMP),
> if other, than HTTP handler.
>
> Problem is that I need only one byte and received packet should be
> passed to exact protocol handler.
>
> I understand, that I will not be able to use erlang  setopt(http)
> feature, so question is the following:
>
> should I better use Yaws or MochiWeb as underlying webserver?
>
> ________________________________________________________________
> erlang-questions mailing list. See http://www.erlang.org/faq.html
> erlang-questions (at) erlang.org
>
>


More information about the erlang-questions mailing list