Thanks to visit codestin.com
Credit goes to github.com

Skip to content

webrtc room should not default to hash/path #1411

@eyaler

Description

@eyaler

webrtc.js room defaults to the hash or path if no room is specified:
opt.rtc.room = opt.rtc.room || GUN.window && (location.hash.slice(1) || location.pathname.slice(1));

This is not well documented, and while for some apps already using the hash as the graph node key this makes sense, in a more general scenario this can be very suprising and cause some issues:

  1. the hash/path is silently leaked, which is a privacy issue
  2. bad hashes can cause errors in sea modules running on peers e.g. Object { "#": "fmhk6VELS", "@": "JVy9cxro9", err: "Unverified data.", _: _(). not sure if this was due to some bad chars or due to my hash being 150k chars long... so maybe don't grab my hash by default ;)
  3. my app uses hashes for internal state, so different clients would not connect over webrtc before i learned i should set a common room key

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions