From: Me
Subject: SOCKS protocol
Date: 
Message-ID: <fro16u$3aq$1@aioe.org>
Hi,

I've got an app, built with Franz Allegro 8.1 that I distribute to 
clients and which makes socket connections back to my server.

Some of the clients of course are sitting behind a firewall and so my 
app needs to be able to deal with their SOCKSv5 proxy...
The Allegro sockets module doesn't support this unfortunately, so I 
thought that perhaps somebody out there knew of a Lisp sockets module 
that does.

My other alternatives are 1. to use a program like FreeCap which manages 
the SOCKS protocol for me, 2. to use some foreign library that manages 
it for me, or 3. to implement the SOCKS5 protocol using Allegro sockets.
These solutions are not ideal as they either mean lots of work for me or 
that the client installs/configures third party software.

Would anybody care to give some advice?

Thanks,

Kevin

From: Paul Tarvydas
Subject: Re: SOCKS protocol
Date: 
Message-ID: <frojns$3u8$1@aioe.org>
Me wrote:

> 3. to implement the SOCKS5 protocol using Allegro sockets.
...
> Would anybody care to give some advice?

I can only offer general advice about implementing protocols.

Use hierarchical state machines.  

Protocol development becomes quite manageable when you implement the
protocol using the abstraction of hierarchical state machines.  [Datum: a
colleague implemented the PPP LCP Option Negotiation Automation protocol
from specs, plus a testbed for it, in two days using the hsm paradigm].

I previously posted an example of how one could implement an hsm in cl:

http://groups.google.ca/group/comp.lang.lisp/msg/3eaef2d9a33df847?dmode=source

Ask (or email me) if you want further discussion of these ideas.

pt
From: Me
Subject: Re: SOCKS protocol
Date: 
Message-ID: <frp2jl$orj$1@aioe.org>
Paul Tarvydas wrote:
> Me wrote:
> 
> 
> Use hierarchical state machines.  
> 

Thanks for the reply Paul.
I've put a little work into implementing SOCKSv5.   It's actually a very 
simple protocol if you don't take authentication into account.   I got 
something rudimentary working in about an hour.

I'll take a look into what you suggest, looks like a nice way to 
organize this.


> 
> Ask (or email me) if you want further discussion of these ideas.
> 
> pt
> 
From: George Neuner
Subject: Re: SOCKS protocol
Date: 
Message-ID: <mnqvt39367mrjdps286ln5iif8r21o2f09@4ax.com>
On Tue, 18 Mar 2008 10:15:11 +0100, Me <··@me.com> wrote:

>Hi,
>
>I've got an app, built with Franz Allegro 8.1 that I distribute to 
>clients and which makes socket connections back to my server.
>
>Some of the clients of course are sitting behind a firewall and so my 
>app needs to be able to deal with their SOCKSv5 proxy...
>The Allegro sockets module doesn't support this unfortunately, so I 
>thought that perhaps somebody out there knew of a Lisp sockets module 
>that does.
>
>My other alternatives are 1. to use a program like FreeCap which manages 
>the SOCKS protocol for me, 2. to use some foreign library that manages 
>it for me, or 3. to implement the SOCKS5 protocol using Allegro sockets.
>These solutions are not ideal as they either mean lots of work for me or 
>that the client installs/configures third party software.
>
>Would anybody care to give some advice?

If you know your way around your Lisp's TCP implementation, you should
be able to support SOCKSv4 in an hour or so.  v5 authentication and
especially UDP support are a whole lot more work.

I looked briefly to see if there was a Lisp SOCKS library available
... didn't find one.  I think most people today just grab one of the C
libraries regardless of whether they need authentication or UDP.

George
--
for email reply remove "/" from address
From: Me
Subject: Re: SOCKS protocol
Date: 
Message-ID: <frp2ph$ps9$1@aioe.org>
George Neuner wrote:
> On Tue, 18 Mar 2008 10:15:11 +0100, Me <··@me.com> wrote:
> 
>> Hi,
> 
> If you know your way around your Lisp's TCP implementation, you should
> be able to support SOCKSv4 in an hour or so.  v5 authentication and
> especially UDP support are a whole lot more work.

Hi George,

Yep, quite simple.   I'm not bothering with SOCKSv4 yet, but I've 
implemented SOCKSv5 without authentication on Allegro Sockets, and it 
was really quite easy.   I don't think I'll be doing anything more than 
supporting CONNECTing and eventually I will need to do the authentication.

> 
> I looked briefly to see if there was a Lisp SOCKS library available
> ... didn't find one.  I think most people today just grab one of the C
> libraries regardless of whether they need authentication or UDP.
> 
> George
> --
> for email reply remove "/" from address

Yeah, I was about to go down the route of using a foreign library and 
then I saw that Hey Presto!   Emacs has a socksv5 implementation!   I 
didn't bother using that code, I just went straight to the protocol and 
realized that it would be a piece of cake.

Thanks for the reply!
From: George Neuner
Subject: Re: SOCKS protocol
Date: 
Message-ID: <3gb0u35tcfs7okq4814ghk7eov817tbvj0@4ax.com>
On Tue, 18 Mar 2008 19:48:19 +0100, Me <··@me.com> wrote:

>George Neuner wrote:
>> On Tue, 18 Mar 2008 10:15:11 +0100, Me <··@me.com> wrote:
>> 
>>> Hi,
>> 
>> If you know your way around your Lisp's TCP implementation, you should
>> be able to support SOCKSv4 in an hour or so.  v5 authentication and
>> especially UDP support are a whole lot more work.
>
>Yep, quite simple.   I'm not bothering with SOCKSv4 yet, but I've 
>implemented SOCKSv5 without authentication on Allegro Sockets, and it 
>was really quite easy.   I don't think I'll be doing anything more than 
>supporting CONNECTing and eventually I will need to do the authentication.

v4 provides the basic TCP stream support, so if you've implemented
that much of v5, you're already supporting v4.

v5 extends v4 with authentication and UDP support.

George
--
for email reply remove "/" from address