2012-06-04 06:03:08 +00:00
|
|
|
from sleekxmpp import Iq
|
|
|
|
from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin
|
|
|
|
|
2012-06-03 17:56:56 +00:00
|
|
|
|
|
|
|
# The protocol namespace defined in the Socks5Bytestream (0065) spec.
|
|
|
|
namespace = 'http://jabber.org/protocol/bytestreams'
|
|
|
|
|
|
|
|
|
|
|
|
class StreamHost(ElementBase):
|
|
|
|
""" The streamhost xml element.
|
|
|
|
"""
|
|
|
|
|
|
|
|
namespace = namespace
|
|
|
|
name = 'streamhost'
|
|
|
|
plugin_attrib = 'streamhost'
|
|
|
|
interfaces = set(('host', 'jid', 'port'))
|
|
|
|
|
|
|
|
|
|
|
|
class StreamHostUsed(ElementBase):
|
|
|
|
""" The streamhost-used xml element.
|
|
|
|
"""
|
|
|
|
|
2012-06-04 05:57:14 +00:00
|
|
|
namespace = namespace
|
2012-06-03 17:56:56 +00:00
|
|
|
name = 'streamhost-used'
|
|
|
|
plugin_attrib = 'streamhost-used'
|
|
|
|
interfaces = set(('jid',))
|
|
|
|
|
|
|
|
|
2012-06-07 17:14:37 +00:00
|
|
|
class Socks5(ElementBase):
|
2012-06-03 17:56:56 +00:00
|
|
|
""" The query xml element.
|
|
|
|
"""
|
|
|
|
|
2012-06-04 05:57:14 +00:00
|
|
|
namespace = namespace
|
2012-06-03 17:56:56 +00:00
|
|
|
name = 'query'
|
2012-06-07 17:14:37 +00:00
|
|
|
plugin_attrib = 'socks'
|
2012-06-03 17:56:56 +00:00
|
|
|
interfaces = set(('sid', 'activate'))
|
|
|
|
sub_interfaces = set(('activate',))
|
|
|
|
|
2012-06-07 17:14:37 +00:00
|
|
|
register_stanza_plugin(Iq, Socks5)
|
|
|
|
register_stanza_plugin(Socks5, StreamHost)
|
|
|
|
register_stanza_plugin(Socks5, StreamHostUsed)
|