more README

This commit is contained in:
Tobias Oberstein
2012-06-21 15:36:51 +02:00
parent 7e51042f6c
commit c33c569987
2 changed files with 48 additions and 5 deletions

View File

@@ -0,0 +1,45 @@
Writing custom PubSub handlers for Authorization
================================================
This example show how to write custom PubSub handlers and use that for
implementing fine-grained authorization.
It includes a server which register a custom PubSub handler for topics,
a JavaScript client using AutobahnJS and a Python client using AutobahnPython
both doing publish and subscribe.
Further, since it's a standard WAMP service, any WAMP client can use
the service. You could access it i.e. from a native Android app via AutobahnAndroid.
Running
-------
Run the server by doing
python server.py
and open
http://localhost:8080/
in **2 tabs/windows** of your browser.
To activate debug output on the server, start it
python server.py debug
This will show up all WAMP messages exchanged between clients and server.
To use the Python client, do
python client.py
Perspective
-----------
Fine-grained authorization for topics is just one application of custom PubSub handlers.
Custom PubSub handlers allow you to hook into the AutobahnPython PubSub machinery
and do very flexible things.

View File

@@ -1,10 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title>Autobahn: PubSub with Authorization</title>
<!-- include AutobahnJS .. that's all you need -->
<script src="http://autobahn.ws/public/autobahn.min.js"></script>
<script src="http://autobahn.s3.amazonaws.com/js/autobahn.min.js"></script>
<script>
// WAMP session object
@@ -56,7 +54,7 @@
sess.publish("event:simple-foobar", {name: "foo",
value: "bar",
num: 333});
sess.publish("event:foobar1", {count: 42});
sess.publish("event:foobar1", {count: -1});
sess.publish("event:foobar2", {count: 666});
@@ -65,7 +63,7 @@
</script>
</head>
<body>
<h1>Autobahn: PubSub with Authorization</h1>
<h1>AutobahnJS PubSub Client - PubSub with Authorization</h1>
<button onclick="test()">Publish Events</button>
</body>
</html>