Hacker News new | past | comments | ask | show | jobs | submit | pthatcherg's comments login

Why don't you like libwebrtc? There's a lot of good stuff in there.


i like webRTC as a technology but it seriously bothered me that any random website can get all my local IP addresses by default.

which dunce at Google was responsible for that?


This is just an initial proposal, and probably will reduce down to one with developer feedback and implementation experience, which is normal for API development.

Whether it's one shape or the other doesn't take affect the network protocol underneath.

If you have constructive ideas of how to simplify the protocol underneath or the API, you can share them with the authors. The people that work on that APIs are always looking for constructive feedback


> Whether it's one shape or the other doesn't take affect the network protocol underneath.

So, the issue I see talks about the API, but the duplication in the specification is at the level of the network protocol: there are different capabilities being exposed and different kinds of headers being attached to the packets.

Honestly, it just isn't clear to me that the entire concept of these stacks is even trying to be simple, and so my experience has been that deep thought that leads to simpler things isn't considered valuable.

I mean, as a single trivial related example: I love WebRTC, I have a giant stack built using it, and I even can mostly defend how it was architected... but the idea that every packet can be tagged as either a string or a binary is superfluous complexity that is not present in any comparable protocol including the now multiple competing specifications for implementing similar things, as we have somehow ended up with all of WebSockets, WebRTC, and WebTransport.

Only, here, in this spec, people not only want string and binary, they want to add a third one?!

https://github.com/WICG/local-peer-to-peer/issues/13

This just isn't needed, and is at the point of strongly coupling the entire protocol to JavaScript, as, otherwise, what even is the difference between a "Blob" and an "ArrayBuffer"?

If you are receiving a packet, you should either always get an ArrayBuffer or a Blob depending on if you want the underlying protocol to construct messages or streams. (And, in this case, it should be a ArrayBuffer.)

It should then be easy to construct a Blob (if we must have this idea at all) from an ArrayBuffer; and it is already (apparently) easy to get a String or ArrayBuffer from a Blob (though this inherently requires a copy; but again: this is a packet oriented protocol, so it should always be using ArrayBuffer).

Meanwhile, there should be a really cheap way of getting a String from an ArrayBuffer, as JavaScript uses UCS-2 anyway, so there is no true "encoding" that happens... it could be this is the case, but I'm pretty sure that the current way to do this always causes a needless copy.

This would not only be sane, this is effectively how the other two related protocols already work: WebTransport doesn't have any of this silliness, nor did WebSockets; they let you configure how you receive data, but that's a decision for the receiver, not the sender.

And I must underscore that point, as if I want to receive data in a steam-like interface to handle someone sending me an insanely large packet (which WebRTC supports btw: you can run out of RAM on a single message), the sender shouldn't be the one to specify "no: you MUST receive this as a single giant ArrayBuffer, as I didn't mark this as Blob".

But like, if you read the issue I linked there, the people working on this are actively trying to encode these kinds of type preservation into the design. In either that issue or a linked one, they discuss that, if they go with a WebTransport-based protocol, maybe they will need to as the spec authors (and not the end developer) define a framing solution to get this feature back.

And so the problem then is that the kind of feedback I have is, inherently, "non-constructive": to me, the problem is that people are being "constructive". And so I am showing up saying "no this thing you want shouldn't happen: you don't need it and you should leave it up to the end-to-end principle for people to build this on top".

The people building this have some kind of use case in mind where they have become excited to build a kind of high-level RPC that they clearly feel requires a serialization format so they can transfer high-level objects across the wire, but I feel that should inherently be out of scope for this kind of specification.

And so "the thing you want isn't what anyone should build" always comes off as "deconstructive", as in some very real sense it must be. I thereby find that people like me just sit around grumbling as we find the entire concept of a web browser muddied up with a billion similar-yet-incompatible ideas all sort of trying to be general purpose and yet each one designed by people with a single use case in mind, and then, often, entirely abandoned later without any attempt to either evolve or normalize it (as is the case with WebRTC, which people seem to have simply given up on, even as it was just starting to get good).


I did something similar a while back: https://github.com/pthatcherg/stunl


WebRTC (with p2p) was done within the W3C, as was a p2p QuicTransport. And this new API is similar to the open screen APIs that have been done in the W3C.

So I'm pretty sure work like this can be done in the W3C.


Try making webrtc work without a domain name and ssl cert. It shipped compromised so it couldn't be used without giving the server the potential to mitm all connections. its not p2p in any sense except network efficiency.


I'm not sure what you mean. It does work without a domain name and SSL cert.


I was one of the original authors of the p2p QuicTansport API and the WebTransport API which is based on it.

I've also recently discussed this new local p2p API with the authors. And I'm in the favor of it, at least in principle.

The difference is that local p2p does not require signaling like, say the p2p done by ICE, WebRTC, or p2p QuicTransport. So for some uses cases, this would be better. And, if done right, this would fit well into a cohesive set of APIs that cover both kinds of p2p.

I'm also in favor of making APIs low level, but I'm not sure if raw sockets is going to work. Keeping congestion control working is pretty important.


The article's information about WebRTC is not accurate. You can do client/server WebRTC without a "signaling server". Just make the server do the signaling. It takes a few extra round trips, but it doesn't need to be an extra server. And WebRTC data channels work quite well as a replacement for WebSockets or SSE, especially if you want to avoid head-of-line blocking. And there are many libraries that will do pretty much all of the work for you, like Pion or str0m.

I also think calling the WebTransport API complex is overblown. If you don't want the more advanced things, you can ignore them. If you want to use it like a WebSocket, just open one bidirectional stream and you're basically done. If you want to avoid head-of-line blocking, just open a stream for every message. It's a little more complex, but it's not the kind of thing you need a library for. Github Copilot will probably write the code for you. It's true there aren't as many server libraries out there yet, since WebTransport is still maturing. And we're waiting for Safari to add support.


> You can do client/server WebRTC without a "signaling server"

Huh. The signalling server is implemented in websocket, typically.

It cant be implemented in webrtc unless you propose a existing decentralization of existing clients to boostrap'


There's also WebTransport


From a server or a native client, you can send whatever RTP packets you want, but you cannot send whatever RTP packets you want from a web client, and you cannot have access to the RTP packets from a web client and do whatever you want with them, at least not very easily. We are working on an extension to WebRTC called RtpTransport that would allow for just that, but it's in early stages of design and standardization.


That's so exciting! I had no idea you were working on this :)

Here [0] is a link for anyone that is looking for it.

[0] https://github.com/w3c/webrtc-rtptransport/blob/main/explain...


It's shame it looks like web clients won't be able to connect to each other p2p. If it supported the use of ICE+DTLS+SCTP or even ICE+QUIC, then it web clients could join in.

Or am I missing something in the docs?


The intent is definitely for web clients to be full, equal participants with P2P connectivity.


It started in the W3C and the IETF group was added later. But thank you for pointing out that a lot of effort is put into making these standards a joint effort across the industry.

(I was one of the original authors in the W3C but left shortly after the BoF happened).


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: