[erlang-questions] Handling non http in mochiweb

Ryan Huffman ryanhuffman@REDACTED
Tue Aug 16 23:45:03 CEST 2011


Does it have to be the same port?  You could use gen_tcp to listen to
connections on a different port and handle the traffic however you would
like.

On Tue, Aug 16, 2011 at 2:40 PM, ori brost <oribrost@REDACTED> wrote:

> I am using mochiweb for a server that may also get a TCP connction to
> which the client sends a simple string (without a newline, the string
> is not http). Mochiweb uses HTTP sockets and therefore fails to detect
> this (i dont even get http_error that i can easily get in mochiweb).
> How can I solve this? Ideally I wish to change mochiweb code to do
> setopt({packet, http_or_raw}) but this kind of thing does not exist.
> How would you recommend handling this? my current idea was to modify
> mochiweb and use erlang:decode_packet, is there a better approach?
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110816/3d7a65a3/attachment.htm>


More information about the erlang-questions mailing list