Open bhyde opened 10 years ago
Thanks for reporting this, fixed!
The walk thru here: http://ozan.io/p/#/walkthrough is borked. I started by following that walk thru, but once i discovered https://github.com/oztu/p/tree/master/examples/ping-pong it became clear that things have changed. Connect takes a hash. The websocket announces new peers via 'connection' rather than 'message'. I probably have a better handle on what else has changed. :)
ps. I'm having fun, thanks.
Ah, sorry, I had fixed it on the front page, but didn't realize the problem occurred elsewhere. I'll update accordingly.
Alright I've updated the walkthrough page as well, I still have to verify the cookbook page to make sure that's up-to-date so I'm going to keep this issue open until I do that.
Now I feel guilty about your weekend, give my apologies to your family. :)
I guess this is related, so I'll add it as a comment here. I'm a bit confused by the 'connection' event. What confuses me you ask? Here are the uses in the examples:
bash-3.2$ pwd
/Users/bhyde/w/p/examples
bash-3.2$ grep "on('connection" */*
party/Charlie.html: p.on('connection', function(peer){
party/alice.html: onramp.on('connection', function(peer){
ping-pong/pong.html: onramp.on('connection', function(peer){
bash-3.2$
The variable onramp appears in the html examples, but it is never declared or initialized.
For example in the walkthru