Le jeudi 25 novembre 2010 12:41:36, Romain Beauxis a écrit :
> If no one objects, I can add the function pretty soon, its not very
> difficult to  add.

Done !

In the latest SVN:
liquidsoap -h harbor.http.register

Register a HTTP handler on the harbor. The given function receives as argument 
the full requested uri (e.g. "foo?var=bar") and the list of HTTP headers and 
returns the answer sent to the client, including HTTP headers. Registered uri 
can be regular expressions (e.g. ".+\.php") and can override default metadata 
handlers.
Category: System
Type: (~port:int, string, ((string, [(string*string)])->string))->unit
Parameters:
* port : int (default None)
    Port to server.
* (unlabeled) : string (default None)
    URI to serve.
* (unlabeled) : (string, [(string*string)])->string (default None)
    Function to execute.

Example:
harbor.http.register(port=8005, ".*",
                                fun (s,h) ->
                                "<html><body><b>Foo!!</b></body></html>")

Happy hacking!
Romain

------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Savonet-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/savonet-users

Reply via email to