import socket host = "ps.pubnub.com" port = 80 s = socket.socket( socket.AF_INET, socket.SOCK_STREAM ) s.connect(( socket.gethostbyname(host), port )) s.send('GET /stream/demo/bot/0/-1 HTTP/1.1\r\nHost: %s\r\n\r\n' % host) while True: print(s.recv(32))
And to gather some of the additional features such as PAM and Presence, you can append two params to the CALL such as authkey=abcd and uuid=abcd. The authkey is for PAM read/write permissions on a per-channel basis. The uuid is for Presence Device/User ID.
s.send('GET /stream/demo/bot/0/-1?auth_key=abcd HTTP/1.1\r\nHost: %s\r\n\r\n' % host)
s.send('GET /stream/demo/bot/0/-1?auth_key=abcd&uuid=abcd123 HTTP/1.1\r\nHost: %s\r\n\r\n' % host)