273 points · by coolelectronics · 4mo ago · 125 comments
Here are a few things you might find interesting:
- This is fully end to end encrypted! We use the WISP protocol for TCP-over-websockets.
- There is a novel WASM->JS JIT for experimental site speedup
- This port cost over 25k in opus/fable tokens for debugging and JIT research
This was just a fun experiment to push the boundaries of WebAssembly. For a more usable "browser in browser" experience, we also built https://github.com/HeyPuter/browser.js that eats a bit less RAM.
> This was just a fun experiment to push the boundaries of WebAssembly
I'm a huge fan of the project, but I have to ask. If spending $25k is a "fun experiment", where exactly is your threshold for serious work?
I'm on the openai $100 sub and frequently my codexbar will show $250 usage in a day. I think it probably doesn't have access to the cached token share too, which probably inflates that a lot.
But the fact remains that those individuals are few. Whereas any schmuck can get Claude to do it (no offense to OP) so at this point I don't even think the money argument is worth discussing even it comes to LLM. For the majority of people a LLM is the difference between being able to do something or not being able to do it.
it was 25k WORTH of API billed tokens, but only actually 1 claude max 5x plan, so it was more like 100 dollars
I recently got a TV based on VIDAA os, a locked-down linux-based OS where everything is rendered from Web pages. It has a built-in browser that doesn't support ad-blocking (I suspect VIDAA is profiting from showing ads on the TV), and you can't install new apps unless they're Web pages.
This would hopefully allow one to run Firefox within the existing browser, then install uBlock Origin within Firefox... I know what this weekend's project is going to be...
You might have a better luck with network level ad blocker like pi-hole or adguard for eg
[chrome-demo] chrome assets ready
[gecko] warning: unsupported syscall: __syscall_madvise
[gecko] embed-xul: main() on the app pthread (PROXY_TO_PTHREAD)
[gecko] embed-xul: GECKO_GL_PASSTHROUGH=1
[gecko] embed-xul: GECKO_COARSE_CLOCK=1
[gecko] embed-xul: GECKO_GPU=1 (GPU/WebRender->canvas rendering)
[gecko] xul_init: GRE dir = /gre
[gecko] Pthread 0x11051000 sent an error! blob:https://developer.puter.com/edc1bd0a-b844-4a18-a69a-63dd49dc304a:8906: SecurityError: Security error when calling GetDirectorydid you enable the about:config option? it may be required
macOS Tahoe 26.5.2 (25F84)
Firefox 152.0.5 (aarch64)
EDIT: Updated, still works on Firefox 152.0.6 (aarch64)javascript.options.wasm_js_promise_integration
We had completely saturated NICs on like the two original servers
this is so rad! 25k tokens is a lot less than i thought this'd take -- what were the difficult bits in the porting process? also, was firefox preferred because parts of it are already in rust?
Firefox was chosen because its single-process support was in a better place than chromium/blink. WebKit is also possible, it was done by a friend of mine earlier https://github.com/theogbob/WebkitWasm
Because you can't. Not even an Extension is able to. Browsers don't want you to bypass their content enforcement. I wish we had at least one hacker friendly browser.
Isolated web apps a chrome feature for developing apps that run in chromium based on HTML (but tbh only really used in Chromebooks) do support raw TCP sockets so if this was ported to an IWA you could have Firefox on a Chromebook without an external server needed.
Extensions can inject headers, such as Access-Control-Allow-Origin: *, to unblock cross-origin requests. In the Manifest V3 context, however, that might require patching window.fetch and window.XMLHttpRequest.
For example,
// content.js
window.fetch = async (...args) => {
const request = args[0] instanceof Request ? args[0].url : args[0]
const config = args[1] || {}
return new Promise((resolve, reject) => {
chrome.runtime.sendMessage({ action: "proxyFetch", request, config }, response => {
if (response.error) {
const err = new Error(response.error.message)
err.name = response.error.name
err.stack = response.error.stack
if (response.error.cause) err.cause = response.error.cause
reject(err)
} else {
const base64Data = response.dataUrl.split(",")[1]
const bytes = Uint8Array.from(atob(base64Data), c => c.charCodeAt(0))
const contentType = response.headers["content-type"] || "application/octet-stream"
const blob = new Blob([bytes], { type: contentType })
const status = response.status
const statusText = response.statusText
const headers = new Headers(response.headers)
const body = status === 204 || status === 205 || status === 304 ? null : blob
resolve(new Response(body, { status, statusText, headers }))
}
})
})
}
// Background.js
chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
if (message.action === "proxyFetch") {
fetch(message.request, message.config)
.then(async res => {
const headers = Object.fromEntries(res.headers.entries())
const blob = await res.blob()
const reader = new FileReader()
reader.onloadend = () =>
sendResponse({ status: res.status, statusText: res.statusText, headers, dataUrl: reader.result })
reader.readAsDataURL(blob)
})
.catch(err => {
const { name, message, code, stack } = err
sendResponse({ error: { name, message, code, stack } })
})
// Keeps the message channel open for the async fetch
return true
}
})I for one am happy that browsers dont let any random web page i visit port scan my internal network.
> "the connection is tunneled over a single WebSocket to a Puter relay"
Come on, it's both a server and a proxy, and it doesn't stop being those things just because you're calling it a relay.
no servers is referring to you not needing to host servers in the same as the term "serverless". Such is the ways of modern tech terms I fear
[0]: https://news.ycombinator.com/item?id=48895945
[1]: https://news.ycombinator.com/user?id=coolelectronics
[2]: https://news.ycombinator.com/item?id=45522061
[3]: https://news.ycombinator.com/item?id=44193514
[4]: https://news.ycombinator.com/item?id=42675696
[5]: https://news.ycombinator.com/item?id=41849494
[6]: https://news.ycombinator.com/item?id=41682779
[7]: https://news.ycombinator.com/item?id=41360683
[8]: https://news.ycombinator.com/item?id=41040761
[9]: https://news.ycombinator.com/item?id=40802253
[A]: https://news.ycombinator.com/item?id=39829463
[B]: https://news.ycombinator.com/item?id=39672886
[C]: https://news.ycombinator.com/item?id=39597030
[D]: https://news.ycombinator.com/item?id=39036897
i never did some wasm but seems it runs quite fast on my macmini m1
Also fascinating how small the wasm binary is. I made a Wasm port of FreeCad (also had a fairly popular thread here a few days ago) but that image was close to 300MB uncompressed / 90MB compressed with Brotli.
(btw none of my wasm CAD ports seem to run, each with slightly different flavors of missing wasm features it seems - I have them linked on https://magik.net if you want to debug for whatever reason)
I tested a bunch of stuff before this post went live Apple M1/M2/M3/M4 on macOS Sequoia, good
Apple M5 and prior chips on tahoe, bad due to a known GPU regression (this is actually why my personal machine runs sequoia)
Windows on ARM Qualcomm Adreno X1 driver - bad to usable performance
Ubuntu 26.04 Aarch64 upstream mesa with freedreno - works really well but encounters artifacting
Pixel 10 Pro - doesn't work here at all
Intel HD4600 on Windows 11 i7-4790k- works quite well up to 2 tabs where the renderer starts really suffering
This is the entirety of the log message.
[chrome-demo] chrome assets + engine wasm ready
[gecko] warning: unsupported syscall: __syscall_madvise
[gecko] embed-xul: main() on the app pthread (PROXY_TO_PTHREAD)
[gecko] embed-xul: GECKO_GL_PASSTHROUGH=0
[gecko] embed-xul: GECKO_COARSE_CLOCK=1
[gecko] [libxul] abort: Assertion failed
[gecko] Aborted(Assertion failed)Still, it is amazing that it works at all!
Then I opened up https://developer.puter.com/labs/firefox-wasm/ in Firefox-in-WebAssembly-in-Chrome
... and sadly it didn't load. I got this in the startup log:
[log] [chrome-demo] chrome assets ready
[warn] [gecko] warning: unsupported syscall: __syscall_madviseThe websites that don't want you to block ads will serve you an obfuscated "inner browser" that will render their site. All your ad blockers, etc, are rendered moot.
Once accessibility is solved this is absolutely going to be a thing on major websites.
(Except embedded ads, that also show now)
I would love to see the details for this. SpiderMonkey had an attempted wasm32 JIT backend, but it was never finished.
edit: Apparently it also has some sort of WebAssembly interpreter backend too, which SpiderMonkey doesn't have.
Every year I need to rewatch this talk
If anything, this is an ad for WASM!
- IME / keyboard doesn't pop on any field
- copy paste
- scrolling with touch
- ai side panel
What works on mobile :
- Extensions !
This is so sick great work; did you try webgpu?
https://github.com/theogbob/WebkitWasm
Not as polished as the firefox port but is a fully working port of webkit ported with fable, opus and some glm 5.2.
Umm, that doesn't sound right. By definition, i dont think you can be end2end encrypted in a web browser, since your server controls what code is run by the web browser. Puter would fully be able to spy on you if they were so inclined because they control what wasm you load.
End to end Encrypted is valid here because both peers of the request (client and server) have their information being exchanged through TLS and they both manage their own keys. We can't look inside the TLS tunnel, we only transport the TCP side. It's end to end encrypted in the same sense that when you go to hackernews your ISP can't see your password because of TLS. The peer you are requesting has ensured only you can see the data, not any intermediary
(Unlike in http where it's completely plain text or a corsproxy where all data is visible to the proxy).
But you could if you were malicious, you control the tunnel creation code.
> It's end to end encrypted in the same sense that when you go to hackernews your ISP can't see your password because of TLS.
But its not like that. I do not have to trust my isp to not be evil. There is nothing my isp can do to read the password. I do have to trust you, you could easily modify the software in a way to read my password.
and by "will work" I mean will render the first frame and then freeze
YMMV
Pixel 10 pro user here