| ▲ | Show HN: Screen Sharing in the Browser(github.com) |
| 219 points by tonghohin 3 months ago | 58 comments |
| Seeing all the hype around Bolt.new, I decided to give it a try, and within just 30 minutes, I built a fully functional web app for screen sharing. How It Works: - One user opens a room and receives a unique code. - Participants join by simply entering the code to view the shared screen. After that initial build, I moved the project to Cursor to continue iterating and enhancing its features. Github: https://github.com/tonghohin/screen-sharing Demo: https://share-your-screen.vercel.app |
|
| ▲ | thrdbndndn 3 months ago | parent | next [-] |
| Did a quick test on Demo site. It works like a charm. One issue: when I stopped sharing, my audience (my another computer) can still see my shared screen (I assume the last frame), what I think it shouldn't. And there is no indication or whatsoever that I have stopped sharing. |
| |
| ▲ | tonghohin 3 months ago | parent [-] | | Thanks for the feedback! I’ll check out the issue. It still has a lot to improve! |
|
|
| ▲ | atmanactive 3 months ago | parent | prev | next [-] |
| Great! Thanks. While we're on the subject of WebRTC, if anyone would need MIDI over WebRTC, here is my take on it: https://github.com/AtmanActive/webmidi-rtc-transport |
| |
| ▲ | Ylpertnodi 3 months ago | parent | next [-] | | Perfect timing!
Seems to suit (some of) my needs, thanks.
And +1 for mentioning sonobus - that's a lot of fun, too. | |
| ▲ | ghusbands 3 months ago | parent | prev [-] | | Browser-based screen sharing is the subject. Is it normal to advertise unrelated projects in HN comments? | | |
| ▲ | atmanactive 3 months ago | parent [-] | | I don't know. Is it? The afore mentioned webapp is based on WebRTC so, not totally unrelated. I have nothing to advertise as I have nothing to gain from this. I just wanted to offer additional solution for people that might find it useful. Also, judging by the other comments, it seems that someone did find it useful. Furthermore, reading through other comments on this thread, there are a lot of other WebRTC projects mentions anyway, and many of them have nothing to do with screen sharing. |
|
|
|
| ▲ | hobo_mark 3 months ago | parent | prev | next [-] |
| Similar tool I like and used to self-host for personal use: https://screego.net/#/ |
|
| ▲ | mvkel 3 months ago | parent | prev | next [-] |
| What I love about developing with cursor et al is it forces devs to keep the app simple. No custom UI bloat when shadcn will do; no feature creep when the outline is fulfilled. Simple apps < 30,000 LOC means cursor can keep the code base in the context window, so its generations stay high quality. |
| |
|
| ▲ | low_tech_love 3 months ago | parent | prev | next [-] |
| Slightly off-topic, but I’ve been searching for a long time for something like this, but for text chat: go to a website; create a room; share a code/link with others; people join and chat; then at some point in the future the room simply disappears (you can save a log if you want). Ideally anonymous with the best possible cryptographic implementation. Has anyone stumbled upon something similar? I hate having to register and login to every chat platform, especially bloated ones like Discord and Slack. The closest one to what I want is gitter but it requires a GitHub signin. |
| |
|
| ▲ | blacktechnology 2 months ago | parent | prev | next [-] |
| This is quite similar to https://screensharing.net. Works like magic. Thanks for sharing! |
|
| ▲ | chuanliang 3 months ago | parent | prev | next [-] |
| Nice work. Similar to https://pin.gl/ |
|
| ▲ | tonghohin 3 months ago | parent | prev | next [-] |
| Just deployed a new feature, audio can also be shared now! But it's only supported in Chrome and Edge, and users must select the option to share a tab. It won't work for sharing a window or whole screen. |
|
| ▲ | sgrodnik 3 months ago | parent | prev | next [-] |
| I'm not sure, but is it possible to make it work on Android? I've tried on my pixel 7a, it gave me the code, I pasted it in another device in Safari, but it was only Loading... on the button. |
| |
|
| ▲ | mandeepj 3 months ago | parent | prev | next [-] |
| Gave it a quick run! Works great. The notification to share your screen goes away quickly. Is there any way to get back to it? I generated a new code to fire the notification again. |
| |
| ▲ | tonghohin 3 months ago | parent [-] | | I just fixed that, the share button should stay forever now until you click it. |
|
|
| ▲ | IshKebab 3 months ago | parent | prev | next [-] |
| If you can get remote control to work that would be amazing. I assume that's impossible with current browser APIs though. A real pain point of Google Meet. |
| |
| ▲ | atoav 3 months ago | parent [-] | | I too yearn for the day where my parents webbrowser can run Win+R and delete their System32 directory after they clicked "Ok" on a prompt whose message they wouldn't be able to tell me if I paid them a billion Euros for it. | | |
| ▲ | IshKebab 3 months ago | parent [-] | | It can already do that. The prompt just says "Click here to download". | | |
| ▲ | atoav 3 months ago | parent [-] | | So you say we need a easily accessible RCE-API to make this even simpler? | | |
| ▲ | IshKebab 3 months ago | parent [-] | | I will ignore your dumb reductionist take... The problem with doing it via downloads or plugins is that it's OS and maybe browser specific (have fun making your plugin for Firefox on Windows, Chrome on Mac, etc.), and also it's extra friction. The reason I want to remote control someone's computer is because talking them through the actions is too tedious. The last thing I want to do is talk them through downloading and installing some browser plugin first. Security & scamming is obviously a concern but let's not pretend it is impossible to solve. People thought the full screen API shouldn't be done because of security concerns, but that's laughable now. As an initial step they could at least support showing a "laser pointer" on other people's screens so you can say "click here" instead of "up a bit, no... go back.. no third from the bottom, yeah that one". That has zero security implications. | | |
| ▲ | atoav 3 months ago | parent [-] | | My 'dumb reductionist take' is me trying to tease out (with a little bit of humor) how you imagine this absolute security nightmare to be implemented in a way that wouldn't result in abuse of apocalyptic proportions. I mean maybe you had something ingenious in mind here, but then I'd like to hear it in detail instead of handweaving and arguing "there are other bad things so let's make it worse by 10 magnitudes". So now without the humor: How would you design the system to prevent abuse, remote code execution and such? Because if that part isn't clear that idea should probably be shelved. | | |
| ▲ | IshKebab 3 months ago | parent [-] | | I would probably do it the same way any other dangerous operations are protected: make people type confirmation in (e.g. how you delete repos on GitHub), require you to manually add websites to a whitelist (e.g. how screen sharing for apps already works on Mac, or how some permissions work on Android). You can use heuristics to provide a more onerous confirmation for suspicious sites, exactly how running executables works on Windows. Other security measures you could do: 1. Throttle events to the speed that a human could do them, so you can't instantly open a terminal and paste code in. 2. Require additional confirmation to sent events to specific applications, like the terminal, or explorer or whatever. 3. Only allow control of apps that are already open. That would be better than nothing. There are probably other things I haven't thought of. Anyway the point is the danger is only two clicks away already. This isn't a risk that isn't already there, it just makes the tech less annoying. | | |
| ▲ | atoav 3 months ago | parent [-] | | Thank you, that sounds somewhat reasonable, but I am still not entirely convinced that the added attack surface is really worth it.. |
|
|
|
|
|
|
|
|
| ▲ | 1oooqooq 3 months ago | parent | prev | next [-] |
| why the source have an accordion and carousel component? :) |
| |
| ▲ | ddtaylor 3 months ago | parent | next [-] | | Are you talking about in components/ui? If so that's ShadCN and it works by fetching components and copy/pasting them into your project rather than trying to continue to keep the components up to date. | |
| ▲ | tonghohin 3 months ago | parent | prev [-] | | don't know why Bolt.new downloaded all the shadcn components for me lol |
|
|
| ▲ | yroc92 3 months ago | parent | prev | next [-] |
| Does this share your screen across domains? If so, how? |
| |
|
| ▲ | typeofhuman 3 months ago | parent | prev | next [-] |
| Would be great if I could share a URL to the room, instead of a room code. |
| |
|
| ▲ | 5evOX5hTZ9mYa9E 3 months ago | parent | prev | next [-] |
| Doesn't work on Linux? |
| |
|
| ▲ | reynaldi 3 months ago | parent | prev | next [-] |
| Awesome demo!
Are you paying for the TURN server? |
| |
| ▲ | tonghohin 3 months ago | parent [-] | | No, it's not using TURN server now. | | |
| ▲ | deathanatos 3 months ago | parent [-] | | > No, it's not using TURN server now. You state it uses PeerJS. And indeed, the code calls from PeerJS, const peer = new Peer();
(https://github.com/tonghohin/screen-sharing/blob/18f6ab93716...)I.e., it constructs a PeerJS Peer without manually specifying PeerOptions. That class, in turn, states, /**
* Configuration hash passed to RTCPeerConnection.
* This hash contains any custom ICE/TURN server configuration.
*
* Defaults to {@apilink util.defaultConfig}
*/
config?: any;
Since we're not overriding it, we take the default. And `defaultConfig` leads us to: https://github.com/peers/peerjs/blob/c073252f879b57757f8a82d... which lists STUN & TURN servers.… so it sure looks to me like it is using a TURN server… | | |
| ▲ | tonghohin 3 months ago | parent [-] | | Sorry for the misleading wording, I was trying to say that I'm not paying for any TURN servers. You are totally right, PeerJS is still using TURN server under the hood. Thanks for pointing that out! |
|
|
|
|
| ▲ | lopkeny12ko 3 months ago | parent | prev | next [-] |
| Immediately upon loading the homepage: > Application error: a client-side exception has occurred (see the browser console for more information). |
| |
| ▲ | tonghohin 3 months ago | parent [-] | | I guess you visited the page right after a new deployment. This happens sometimes due to a version mismatch in Next.js after deployment. Refreshing the page should fix it! |
|
|
| ▲ | antback 3 months ago | parent | prev | next [-] |
| It works great!! I Like it! |
|
| ▲ | humptybumpty 3 months ago | parent | prev | next [-] |
| - |
| |
| ▲ | kapitanjakc 3 months ago | parent [-] | | For mobile I find google meet the best, I think even Whatsapp is now allowing to screen share. |
|
|
| ▲ | anduc 3 months ago | parent | prev | next [-] |
| wow, I didn't know this was possible |
|
| ▲ | karhuton 3 months ago | parent | prev | next [-] |
| [dead] |
|
| ▲ | shivamrishi 3 months ago | parent | prev [-] |
| [dead] |