pubsubio / pubsub-hub Goto Github PK
View Code? Open in Web Editor NEWa query based message hub
Home Page: pubsub.io
a query based message hub
Home Page: pubsub.io
WebSocket doesn't work with pubsub-hub in Chrome anymore, the reason is this:
http://blog.chromium.org/2011/08/new-websocket-protocol-secure-and.html
We need to support HyBi-10
{
to: signed.user1
} // works
{
$or: [{
to:signed.user1
},{
to:signed.user2
}]
} // does not work
{
to: {$any: [signed.user1, signed.user2]}
} // does not work
I've already implemented this locally - we just need to review it
publisherWhitelist = ["10.0.0.1/22", "....", "...." ]
https://github.com/pubsubio/pubsub-hub/blob/master/node_modules/json-sockets/index.js#L187
This line is currently:
'HTTP/1.1 101 Web Socket Protocol Handshake',
Should be changed to:
'HTTP/1.1 101 WebSocket Protocol Handshake',
According to: http://en.wikipedia.org/wiki/WebSockets#WebSocket_Protocol_Handshake
C#'s WebSocket libraries test for this and refuse to connect.
I've tested this and the Chrome WebSocket libraries does not appear to care if this specification is met.
@JedSchmidt has some good points about functions, extending the query language, we need to get the auth story right, before doing it. We also need to make the right optimizations so we dont compromise the hub.
Running:
// to connect in node.js do:
var pubsub = require('pubsub.io').connect('127.0.0.1:9999');
results in the following stacktrace on the hub:
TypeError: Cannot call method 'replace' of undefined
at sign (/home/archie/tools/pubsub-hub/node_modules/websock/index.js:17:22)
at Array.forEach (native)
at sign (/home/archie/tools/pubsub-hub/node_modules/websock/index.js:16:11)
at handshake0 (/home/archie/tools/pubsub-hub/node_modules/websock/index.js:48:14)
at exports.onupgrade (/home/archie/tools/pubsub-hub/node_modules/websock/index.js:137:76)
at Array.router [as 0] (/home/archie/tools/pubsub-hub/node_modules/router/index.js:92:6)
at find (/home/archie/tools/pubsub-hub/node_modules/router/index.js:33:19)
at Server.fn (/home/archie/tools/pubsub-hub/node_modules/router/index.js:66:7)
at Server.EventEmitter.emit (events.js:115:20)
at Socket.socket.ondata (http.js:1710:14)
Using:
dev โ pubsub.io-client node --version
v0.8.9
on:
dev โ pubsub.io-client uname -rvpo
3.2.0-23-generic #36-Ubuntu SMP Tue Apr 10 20:39:51 UTC 2012 x86_64 GNU/Linux
Any clues as to why this is happening or how it can be solved?
Best regards,
Marcus
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.