[Lispweb] Araneida and server aliases

Brian Mastenbrook bmastenb at cs.indiana.edu
Mon Mar 14 07:31:30 CST 2005


On Mar 14, 2005, at 2:09 AM, Ivan Toshkov wrote:

> Hi list,
>
> When I install a handler in araneida I have to say e.g.:
>
> (install-handler parent child "http://localhost/whatever" nil)
>
> Pointing the browser to the above URL runs the handler, but not so if 
> you try
> {URL: http://127.0.0.1/whatever} or {URL: 
> http://the.domain.name/whatever}
>
> Is there a better way to do that besides installing the same handler 
> multiple
> times?
>
> Cheers,
> Ivan

Hi Ivan,

Araneida is set up for virtual hosting by default. One way you can use 
to get around this is to use a reverse-proxy listener handler to 
translate any alias of the URL that you want to use to the URL root 
that you have passed to install-handler. For instance:

(defvar *listener*
   (make-instance #+sbcl
		 'araneida:serve-event-reverse-proxy-listener
		 #-sbcl
		 'araneida:threaded-reverse-proxy-listener
		 :translations
		 `(("http://localhost/"
		    "http://127.0.0.1")
		   ("http://localhost/"
		    "http://my.domain.name/"))
		 :address #(127 0 0 1)
                    :port (araneida:url-port fwd-url)))

Hope this helps.
--
Brian Mastenbrook
chandler at unmutual.info
http://www.iscblog.info/




More information about the lispweb mailing list