[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Q: luasocket https client?
- From: Diego Nehab <diego@...>
- Date: Fri, 13 Feb 2009 22:31:30 -0500 (EST)
I don't see why you wouldn't be able to nest as many proxies
as you need.
maybe my "create" function can return a proxy for socket with an
overide for "connect" that does the ssl initialization.
That is exactly right.
Not entirely clear how this would work since the ssl.wrap
function seems to return a proxy of its own. Should I set
a new metatable on self inside the proxy "connect" method?
Are we allowed to do that?
The function you pass to "create" returns an object that
does all that. It starts as a table that has a field 'c', a
field connect, and a metatable that forwards all other
requests to 'c'. When somebody calls connect on this table,
it simply calls connect on c, replaces c with a ssl.wrap, and
calls dohandshake on the new c. That's it, right?