moose-team / friends

:tv: P2P chat powered by the web.
http://moose-team.github.io/friends/
MIT License
3.17k stars 341 forks source link

add multicast swarm #47

Closed beaugunderson closed 7 years ago

beaugunderson commented 9 years ago

i also added a npm run build-for-electron that rebuilds leveldb and mdns...

would be great if a couple of people could test this one! (bonus points if two people can test locally to verify the multicast swarm works somewhere other than my laptop)

:sparkles:

bcomnes commented 9 years ago

I'll try to test it out.

beaugunderson commented 9 years ago

(rebased)

bcomnes commented 9 years ago

Hrmm... just getting a blank electron window

beaugunderson commented 9 years ago

check debug.log? (also pull that branch again, i rebased it a minute ago to fix the conflicts)

On Thu, Apr 30, 2015 at 8:29 PM, Bret Comnes notifications@github.com wrote:

Hrmm... just getting a blank electron window

— Reply to this email directly or view it on GitHub https://github.com/moose-team/friends/pull/47#issuecomment-98036137.

bcomnes commented 9 years ago

Only output on the terminal is:

dyld: lazy symbol binding failed: Symbol not found: __ZN2v89Signature3NewEPNS_7IsolateENS_6HandleINS_16FunctionTemplateEEEiPS5_
  Referenced from: /Users/bret/Documents/projects/friends/node_modules/mdns-swarm/node_modules/mdns/build/Release/dns_sd_bindings.node
  Expected in: dynamic lookup
dyld: Symbol not found: __ZN2v89Signature3NewEPNS_7IsolateENS_6HandleINS_16FunctionTemplateEEEiPS5_
  Referenced from: /Users/bret/Documents/projects/friends/node_modules/mdns-swarm/node_modules/mdns/build/Release/dns_sd_bindings.node
  Expected in: dynamic lookup
beaugunderson commented 9 years ago

oh, run npm run build-for-electron to fix, sorry

ungoldman commented 9 years ago

Does this add another rebuild step necessary for DB changes? If so we might as well generalize the task to npm run rebuild and save ourselves some typing?

beaugunderson commented 9 years ago

that's what I did :)

rebuild is already a task in npm so I put both leveldb and mdns underneath build-for-electron

ungoldman commented 9 years ago

Ah, thanks for dropping the knowledge! Didn't know rebuild was already a thing.

beaugunderson commented 9 years ago

no prob, we didn't know it was the other day either; it started off named that and then got renamed

bcomnes commented 9 years ago

This was even after I ran npm run build-for-electron. I'm running iojs and updated npm using pangyp. Maybe part of the problem? I'll try with plain node this evening.

beaugunderson commented 9 years ago

weird; try npm install -g node-gyp-install; node-gyp-install

that's what I do under iojs

bcomnes commented 9 years ago

ok i will try that... friggin gyp

bcomnes commented 9 years ago

Trying again

ungoldman commented 9 years ago

Got it working locally with @bcomnes ... it's definitely a little finicky/buggy though.

  1. Got a "accept incoming network connections from Electron Helper.app" dialog
  2. Seeing a fair number of log errors:
∴ ng@crimelab ~/dev/github/friends (add-multicast) $ npm start

> friends@1.0.0 start /Users/ng/dev/github/friends
> npm run build-css && electron index.js 2>&1 | silence-chromium

> friends@1.0.0 build-css /Users/ng/dev/github/friends
> mkdirp dist && stylus -u nib css/app.styl -o dist/ -c

  compiled dist/app.css
[16225:0502/155108:WARNING:dns_config_service_posix.cc(292)] Failed to read DnsConfig.
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(160)] "Uncaught Error: type friends-scramble has more than 15 characters", source: /Users/ng/dev/github/friends/node_modules/mdns-swarm/node_modules/mdns/lib/service_type.js (160)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(232)] "(node) warning: possible EventEmitter memory leak detected. %d %s listeners added. Use emitter.setMaxListeners() to increase limit.", source: events.js (232)
[16225:0502/155109:INFO:CONSOLE(160)] "Uncaught Error: type friends-scramble has more than 15 characters", source: /Users/ng/dev/github/friends/node_modules/mdns-swarm/node_modules/mdns/lib/service_type.js (160)
[16225:0502/155110:INFO:CONSOLE(73)] "getaddrinfo ENOTFOUND github.com github.com:443", source: /Users/ng/dev/github/friends/app.js (73)
[16225:0502/155110:INFO:CONSOLE(185)] "→ GET err /connectivity: Error: connect ENETUNREACH 169.254.52.211:60180 - Local (0.0.0.0:52674)", source: /Users/ng/dev/github/friends/node_modules/mdns-swarm/mdns-swarm.js (185)
[16225:0502/155110:INFO:CONSOLE(185)] "→ GET err /connectivity: Error: connect ENETUNREACH 169.254.52.211:60179 - Local (0.0.0.0:52675)", source: /Users/ng/dev/github/friends/node_modules/mdns-swarm/mdns-swarm.js (185)
[16225:0502/155110:INFO:CONSOLE(185)] "→ GET err /connectivity: Error: connect ENETUNREACH 169.254.52.211:60180 - Local (0.0.0.0:52676)", source: /Users/ng/dev/github/friends/node_modules/mdns-swarm/mdns-swarm.js (185)
[16225:0502/155110:INFO:CONSOLE(185)] "→ GET err /connectivity: Error: connect ENETUNREACH 169.254.52.211:60179 - Local (0.0.0.0:52677)", source: /Users/ng/dev/github/friends/node_modules/mdns-swarm/mdns-swarm.js (185)

Pretty cool to see it working at all though. :+1:

ungoldman commented 9 years ago

@beaugunderson actually disregard that last one, communication was happening over bluetooth. When we disabled bluetooth nothing came through :(

bcomnes commented 9 years ago

This is what saw:

Bret-MBR:friends bret$ npm start

> friends@1.0.0 start /Users/bret/Documents/projects/friends
> npm run build-css && electron index.js 2>&1 | silence-chromium

> friends@1.0.0 build-css /Users/bret/Documents/projects/friends
> mkdirp dist && stylus -u nib css/app.styl -o dist/ -c

  compiled dist/app.css
[10170:0502/155705:WARNING:dns_config_service_posix.cc(292)] Failed to read DnsConfig.
[10170:0502/155706:INFO:CONSOLE(73)] "Request to https://api.github.com/search/users?q=bcomnes%40gmail.com%20in%3Aemail failed", source: /Users/bret/Documents/projects/friends/app.js (73)
[10170:0502/155706:INFO:CONSOLE(160)] "Uncaught Error: type friends-moose-team has more than 15 characters", source: /Users/bret/Documents/projects/friends/node_modules/mdns-swarm/node_modules/mdns/lib/service_type.js (160)
[10170:0502/155706:INFO:CONSOLE(160)] "Uncaught Error: type friends-moose-team has more than 15 characters", source: /Users/bret/Documents/projects/friends/node_modules/mdns-swarm/node_modules/mdns/lib/service_type.js (160)
[10172:0502/155712:ERROR:rtc_peer_connection_handler.cc(1027)] Error processing ICE candidate.
[10172:0502/155712:ERROR:rtc_peer_connection_handler.cc(1027)] Error processing ICE candidate.
beaugunderson commented 9 years ago

ahhh, i wasn't aware of the 15 character limit for one (i guess i'll hash them or put the channel in a TXT key) the ICE candidate errors i see regardless of multicast sometimes

bcomnes commented 9 years ago

We also didn't test with a router.... just the Create Network... network option that OS X offers (which results in Self assigned IPs). Maybe with an internet-less router we would have had success. We should try with a router next time.

beaugunderson commented 7 years ago

will revisit this if friends becomes active again :)