summaryrefslogtreecommitdiff
path: root/sleekxmpp/plugins/xep_0065/stanza.py
diff options
context:
space:
mode:
authorLance Stout <lancestout@gmail.com>2012-06-07 10:40:22 -0700
committerLance Stout <lancestout@gmail.com>2012-06-07 10:40:22 -0700
commit7247efe05518ad9468dc52a6066f38f78cbc599e (patch)
tree115d2434304da7985406009ba5f6cbee45748949 /sleekxmpp/plugins/xep_0065/stanza.py
parentf5652a667bfcf896c6078888fe7ec68e21db305d (diff)
parent8def3758e4e849f25001e1e76616fcc3836bd1c2 (diff)
downloadslixmpp-7247efe05518ad9468dc52a6066f38f78cbc599e.tar.gz
slixmpp-7247efe05518ad9468dc52a6066f38f78cbc599e.tar.bz2
slixmpp-7247efe05518ad9468dc52a6066f38f78cbc599e.tar.xz
slixmpp-7247efe05518ad9468dc52a6066f38f78cbc599e.zip
Merge pull request #169 from SeyZ/develop
xep_0065 plugin (Socks5 Bytestreams)
Diffstat (limited to 'sleekxmpp/plugins/xep_0065/stanza.py')
-rw-r--r--sleekxmpp/plugins/xep_0065/stanza.py41
1 files changed, 41 insertions, 0 deletions
diff --git a/sleekxmpp/plugins/xep_0065/stanza.py b/sleekxmpp/plugins/xep_0065/stanza.py
new file mode 100644
index 00000000..ae57aba8
--- /dev/null
+++ b/sleekxmpp/plugins/xep_0065/stanza.py
@@ -0,0 +1,41 @@
+from sleekxmpp import Iq
+from sleekxmpp.xmlstream import ElementBase, register_stanza_plugin
+
+
+# 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.
+ """
+
+ namespace = namespace
+ name = 'streamhost-used'
+ plugin_attrib = 'streamhost-used'
+ interfaces = set(('jid',))
+
+
+class Socks5(ElementBase):
+ """ The query xml element.
+ """
+
+ namespace = namespace
+ name = 'query'
+ plugin_attrib = 'socks'
+ interfaces = set(('sid', 'activate'))
+ sub_interfaces = set(('activate',))
+
+register_stanza_plugin(Iq, Socks5)
+register_stanza_plugin(Socks5, StreamHost)
+register_stanza_plugin(Socks5, StreamHostUsed)