node-red / node-red-nodes

Extra nodes for Node-RED
Other
988 stars 593 forks source link

Physical Web Node: URL too short? #191

Closed TotallyInformation closed 8 years ago

TotallyInformation commented 8 years ago

I've been trying to get the Physical Web node to work and the 18char limit on the URL seems too short. The example given on the Eddystone website is https://goo.gl/S6zT6P which is more than 18chars. As far as I can see it is impossible to use the Google shortener to get anything less than 21 chars.

Have I misunderstood?

hardillb commented 8 years ago

The spec has some techniques for trimming the length of the actual broadcast URL. Some common prefixes and postfixes are trimmed to a single byte.

e.g. 'http://', 'https://' or 'http://www.' are all trimmed off the start

'.com', '.net' and similar early (US/global) TLDs are trimmed off the end

The filters on the node config are not smart enough to do this at the moment so just enforces a blanket 18 char limit.

Try using the http://is.gd shortner

And remember that both the URL you point to and the shortened link need to be https for Chrome (on Android) to show them. The physical web android app will work with http links and so will at lest the older version on iOS

TotallyInformation commented 8 years ago

Ah, so I firstly need to have NR running as https. Secondly, it is worth noting that most of the shorteners don't support non-Internet routable addresses so I can post a 192.168.x.x address for example.

I also discovered that when I pass a url to the output node from an inject, it doesn't object to the length but when I enter it manually into that node, it does. However, when passing in, I only see a green square and no address. Something has happened though because Chrome on iOS now knows that there is a device somewhere near (I don't have any other devices to play with other than the Pi), it shows a message to say it is listening on the today view (it didn't before) but doesn't show the link, presumably because it isn't an https url.

hardillb commented 8 years ago

The address has to be publicly reachable for Chrome as well, because all requests at discovery go through a public proxy (to protect people from being tracked). The Physical Web app also uses the proxy, but it just shows the URL if it can't reach it publicly

TotallyInformation commented 8 years ago

Thanks. Call me cynical though but the reasoning is interesting - surely the worlds biggest advertising money-maker has nothing to gain from being the gatekeeper of all those IoT connections :-/

Anyway, thanks for the help. I can now see the link on my today screen having used the standard Google URL as an example.

Also interesting, I downloaded Physical Web for iOS and it is happy to find things on my local network - at least as long as they have http://somename.local:port - is.gd is actually happy to shorten those. Weirdly, that app is also finding some other URL's on my local network - possibly advertised via Bonjour, certainly not via BT.

hardillb commented 8 years ago

Bonjour is also part of the Physical Web spec.

201 was merged yesterday and adds support for doing the single byte substitutions for the schema and well known TLDs. So I'm going to close this now