[Twisted-Python] Announcement: txHybridCluster client released

2011-09-12 Thread Luke Marsden
Hi all,

>From a blustery grey Monday morning in Bristol, England, comes the
announcement of the immediate availability of a Twisted client for
interacting with the Hybrid Cluster API.

https://github.com/hybridlogic/txHybridCluster

http://www.hybrid-cluster.com/
http://www.hybrid-cluster.com/api/

The Hybrid Cluster API allows you to set up websites, databases,
mailboxes, add SSL certificates, configure custom DNS, and more (over
100 API functions are documented).

If anyone's interested in building cool stuff with this, contact me
off-list and we can get you set up with a cluster to play with ;-)

-- 
Best Regards,
Luke Marsden
CTO, Hybrid Logic Ltd.

Web: http://www.hybrid-cluster.com/
Hybrid Web Cluster - cloud web hosting

Mobile: +447791750420 (UK) / +1-415-449-1165 (US)




___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Twisted Perspective Broker: get client ip

2011-09-12 Thread Andrea Di Mario
Hi, i'm writing a perspective broker server. Now, i should get the
client IP, that perspective broker writes well in the log. I've tried
to get it from MyRealm with: mind.broker.transport.getPeer(), without
success. I've tried self.transport.getPeer() to, with this result:
exceptions.AttributeError: Listner instance has no attribute 'transport'
It's strange, because PB wrote the client IP, infact in log i've line with:
2011-09-11 16:41:58+0200 [Broker,0,127.0.0.1] 

Could you suggest me something?
Thanks.
Here the code:

from OpenSSL import SSL
from twisted.internet import reactor, ssl
from ConfigParser import SafeConfigParser
from twisted.python import log
from twisted.spread import pb
from twisted.cred import checkers, portal
from zope.interface import implements
import hashlib

class Listner(pb.Avatar):

   def __init__(self, name):
   self.name = name

   def perspective_getDictionary(self, dictionary):
  print dictionary

   def perspective_simplyAccess(self, access):
  print access

def verifyCallback(connection, x509,  errnum, errdepth, ok):
   if not ok:
  log.msg("Certificato non valido: %s" % x509.get_subject())
  return False
   else:
  log.msg("Connessione stabilita, vertificato valido: %s" %
x509.get_subject())
   return True


class MyRealm:
implements(portal.IRealm)
def requestAvatar(self, avatarId, mind, *interfaces):
if pb.IPerspective not in interfaces:
raise NotImplementedError
return pb.IPerspective, Listner(avatarId), lambda:None


if __name__ == "__main__":

   CONFIGURATION = SafeConfigParser()
   CONFIGURATION.read('server.conf')
   PORT = CONFIGURATION.get('general', 'port')
   LOGFILE = CONFIGURATION.get('general', 'log')

log.startLogging(open(LOGFILE,'a'))


   myContextFactory =
ssl.DefaultOpenSSLContextFactory(CONFIGURATION.get('general',
'keypath'), CONFIGURATION.get('general', 'certpath'))
   ctx = myContextFactory.getContext()
   ctx.set_verify(SSL.VERIFY_PEER |
SSL.VERIFY_FAIL_IF_NO_PEER_CERT, verifyCallback)

   ctx.load_verify_locations(CONFIGURATION.get('general', 'cacert'))

   p = portal.Portal(MyRealm())
   c = checkers.FilePasswordDB('passwords.txt',
caseSensitive=True, cache=True)
   p.registerChecker(c)
   factory = pb.PBServerFactory(p)
   reactor.listenSSL(int(PORT), factory, myContextFactory)
   reactor.run()

-- 
Andrea Di Mario

___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


[Twisted-Python] Autobahn WebSockets - Twisted based WS implementation

2011-09-12 Thread Tobias Oberstein
Announcing Autobahn WebSockets

Autobahn WebSockets provides an implementation of the WebSockets protocol
which can be used to build WebSockets clients and servers.

   * supports protocol draft version 10-14
   * usable for clients and servers
   * easy to use basic API
   * advanced API for frame-based/streaming processing
   * very good standards conformance
   * fully asynchronous Twisted-based implementation
   * Open-source (Apache 2 license)

Testsuite

Autobahn WebSockets also includes a WebSockets test suite which can used to
test client and server implementations for protocol conformance.
The test suite includes over 200 test cases and has broad protocol coverage and
is used with several WS projects.

RPC/PubSub

Autobahn WebSockets also provides an implementation of the

   WebSocket Application Messaging Protocol (WAMP)
   http://www.tavendo.de/autobahn/protocol.html

which can be used to build applications around Remote Procedure Call and
Publish & Subscribe messaging patterns.

   * provides RPC and PubSub messaging
   * built on JSON and WebSockets
   * simple and open protocol
   * usable for clients and servers

For more information, please visit: http://www.tavendo.de/autobahn

Commercial support and services is available from Tavendo GmbH.

Other resources:

http://pypi.python.org/pypi/autobahn
https://github.com/oberstet/Autobahn
http://groups.google.com/group/autobahnws
http://en.wikipedia.org/wiki/Comparison_of_WebSocket_implementations
http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-14


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Autobahn WebSockets - Twisted based WS implementation

2011-09-12 Thread Glyph Lefkowitz
On Sep 12, 2011, at 9:15 AM, Tobias Oberstein wrote:

> Announcing Autobahn WebSockets
> 
> Autobahn WebSockets provides an implementation of the WebSockets protocol
> which can be used to build WebSockets clients and servers.
> 
>   * supports protocol draft version 10-14
>   * usable for clients and servers
>   * easy to use basic API
>   * advanced API for frame-based/streaming processing
>   * very good standards conformance
>   * fully asynchronous Twisted-based implementation
>   * Open-source (Apache 2 license)

Hi Tobias - great to hear it, thanks for the announcement!

I'm curious - is this in any way related to previous work done on Twisted 
websockets implementations, such as ?

Thanks!

-glyph
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Autobahn WebSockets - Twisted based WS implementation

2011-09-12 Thread Tobias Oberstein
> Hi Tobias - great to hear it, thanks for the announcement!
> 
> I'm curious - is this in any way related to previous work done on Twisted
> websockets implementations, such as
> ?

No, it's not. From a cursory look at the code (didn't knew it existed):

Outdated WS protocol, probably wasnt complete at any time, based on the Site 
class.

Autobahn WS has complete, current WS support. Code base is roughly 9k LOC.


___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Autobahn WebSockets - Twisted based WS implementation

2011-09-12 Thread Reza Lotun
Hi,

On Mon, Sep 12, 2011 at 4:38 PM, Tobias Oberstein <
tobias.oberst...@tavendo.de> wrote:
>
> No, it's not. From a cursory look at the code (didn't knew it existed):
>

That repo on Github is based on a Twisted branch that was nearly ready for
inclusion into Twisted. This was back in the day when the websocket protocol
seemed on the verge of stabilizing. Obviously this wasn't the case. I came
along and added cross version support for the next iteration of the protocol
which was then newly supported in Chrome. Then there came the discovery of a
cache poising security flaw that was eventually addressed in the latest
iteration of the websocket protocol. I haven't yet had time to incorporate
it, though I believe there is an open pull request for its support (thanks,
to whoever that was).


> Outdated WS protocol, probably wasnt complete at any time, based on the
> Site class.
>

Depends on what you consider to be "complete" I guess. It had working
examples and stayed close to the reference Twisted implementation, which was
in the last stages of its code review.


> Autobahn WS has complete, current WS support. Code base is roughly 9k LOC.


Completeness shouldn't really be measured by size of code base. I take your
point that the latest version of the protocol is indeed supported in
Autobahn, which is a good thing of course.

Thanks for Autobahn - it's useful to take a look at. I'll still continue
work on txWebsocket, however, with the intention of:

* eventual inclusion into Twisted (meeting Twisted coding standards, MIT
license, etc.)
* small, simple code base

Hopefully one day if and when txWebSocket is finally merged we can
standardize on one reference implementation (it doesn't have to be
txWebsocket of course - it'd be great if the core of Autobahn could be
contributed...)

Thanks,
Reza

-- 
Reza Lotun
mobile: +44 (0)7521 310 763
email:  rlo...@gmail.com
work:   rlo...@twitter.com
@rlotun
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python


Re: [Twisted-Python] Autobahn WebSockets - Twisted based WS implementation

2011-09-12 Thread Tobias Oberstein
Hello Reza,

the WS protocol has indeed changed alot from hixie-76. There are binary frames, 
new framing scheme, interspersed control
frames, masking, etc etc.

Currently, it's in the last review phase involving IESG/IAB members, and the WG 
chairs want to cross the finish line
in November on WS 1.0 final.

Code base size should not be a measure of completeness, of course. With regard 
to Autobahn WS, I would nevertheless
say it's quite complete, since it includes a WS test suite with >200 test cases 
that cover a lot of the spec - and passes all.

The tests are quite rigorous, for example I've taken the pains to implement own 
UTF-8 payload validator, since
the one that comes with Python has outstanding issues related to surrogate 
pairs.

Also, the test suite is used already with a couple of server frameworks, and it 
found several bugs both in
Firefox and Chrome. Of course the test suite increases the total code size.

Another area that took time/code is: support for message-based, frame-based and 
streaming APIs. I expect (hope;)
that the code structuring that was necessary for the latter helps when 
implementing - a yet to be defined/agreed -
multiplexing scheme over WS. This was also one reason why I didn't base the 
code on Site, but Protocol directly.

Anyway, it's good to hear that you're planning to take up development again .. 
choice is good.

Regards,
Tobias


Von: twisted-python-boun...@twistedmatrix.com 
[mailto:twisted-python-boun...@twistedmatrix.com] Im Auftrag von Reza Lotun
Gesendet: Montag, 12. September 2011 18:10
An: Twisted general discussion
Betreff: Re: [Twisted-Python] Autobahn WebSockets - Twisted based WS 
implementation

Hi,

On Mon, Sep 12, 2011 at 4:38 PM, Tobias Oberstein 
mailto:tobias.oberst...@tavendo.de>> wrote:
No, it's not. From a cursory look at the code (didn't knew it existed):

That repo on Github is based on a Twisted branch that was nearly ready for 
inclusion into Twisted. This was back in the day when the websocket protocol 
seemed on the verge of stabilizing. Obviously this wasn't the case. I came 
along and added cross version support for the next iteration of the protocol 
which was then newly supported in Chrome. Then there came the discovery of a 
cache poising security flaw that was eventually addressed in the latest 
iteration of the websocket protocol. I haven't yet had time to incorporate it, 
though I believe there is an open pull request for its support (thanks, to 
whoever that was).

Outdated WS protocol, probably wasnt complete at any time, based on the Site 
class.

Depends on what you consider to be "complete" I guess. It had working examples 
and stayed close to the reference Twisted implementation, which was in the last 
stages of its code review.

Autobahn WS has complete, current WS support. Code base is roughly 9k LOC.

Completeness shouldn't really be measured by size of code base. I take your 
point that the latest version of the protocol is indeed supported in Autobahn, 
which is a good thing of course.

Thanks for Autobahn - it's useful to take a look at. I'll still continue work 
on txWebsocket, however, with the intention of:

* eventual inclusion into Twisted (meeting Twisted coding standards, MIT 
license, etc.)
* small, simple code base

Hopefully one day if and when txWebSocket is finally merged we can standardize 
on one reference implementation (it doesn't have to be txWebsocket of course - 
it'd be great if the core of Autobahn could be contributed...)

Thanks,
Reza

--
Reza Lotun
mobile: +44 (0)7521 310 763
email:  rlo...@gmail.com
work:   rlo...@twitter.com
@rlotun
___
Twisted-Python mailing list
Twisted-Python@twistedmatrix.com
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python