hi,
is there any lisp code ( as short as possible ) for a http proxy. I'm using cmucl on linux.
(defun launch-proxy ( local-port other-server )
"all local requests on port 'local-port' are redirected to 'other-server:80' and the response sent back to client"
...
)
thx.
On Thu, May 06, 2004 at 06:53:23PM +0200, Christophe Turle wrote:
> is there any lisp code ( as short as possible ) for a http proxy. I'm using
> cmucl on linux.
Portable Allegroserve can act as an HTTP proxy server, if I'm not
mistaken.
--
; Matthew Danish <·······@andrew.cmu.edu>
; OpenPGP public key: C24B6010 on keyring.debian.org
; Signed or encrypted mail welcome.
; "There is no dark side of the moon really; matter of fact, it's all dark."
Christophe Turle wrote:
> hi,
>
> is there any lisp code ( as short as possible ) for a http proxy. I'm
> using cmucl on linux.
>
> (defun launch-proxy ( local-port other-server )
> "all local requests on port 'local-port' are redirected to
> 'other-server:80' and the response sent back to client"
> ...
> )
I don't have code for you, but if this is your only requirement, it's
trivial, and requires nothing specific to http. Just open a connection
to the real server when you get one on the local port, then loop,
waiting on data or EOF from either connection and sending it to the
other one.
20 lines?
--
Cameron MacKinnon
Toronto, Canada
(message (Hello 'Cameron)
(you :wrote :on '(Thu, 06 May 2004 13:24:55 -0400))
(
CM> I don't have code for you, but if this is your only requirement,
CM> it's trivial, and requires nothing specific to http. Just open a
CM> connection to the real server when you get one on the local port,
CM> then loop, waiting on data or EOF from either connection and
CM> sending it to the other one.
as i remember, when we did that simple type of proxy - with C socket API -
there was some problems, with that EOF..
possibly that was just a bug in implementation, but that proxy was almost
unusable..
)
(With-best-regards '(Alex Mizrahi) :aka 'killer_storm)
(prin1 "Jane dates only Lisp programmers"))
Cameron MacKinnon wrote:
> Christophe Turle wrote:
>
>> hi,
>>
>> is there any lisp code ( as short as possible ) for a http proxy. I'm
>> using cmucl on linux.
>>
>> (defun launch-proxy ( local-port other-server )
>> "all local requests on port 'local-port' are redirected to
>> 'other-server:80' and the response sent back to client"
>> ...
>> )
>
>
> I don't have code for you, but if this is your only requirement, it's
> trivial, and requires nothing specific to http. Just open a connection
> to the real server when you get one on the local port, then loop,
> waiting on data or EOF from either connection and sending it to the
> other one.
>
> 20 lines?
>
yes you're right. Easy and very few lines (with cmucl).
thx.