9 ms·
Show HN: Host a Website in the URL
I wrote this silly thing a couple of weeks ago. It's absolutely useless but it's a fun tech demo for my web server library. Enjoy!
- Helmut10001 3y agoI wonder what happens about the liability for content on these URL-websites. Is the liability now on the one who shares the URL, or on those who serves it?
- Raed667 3y agoSince (from my understanding) unzipping the content happens on the server, then the server in my opinion is still responsible for the content.
- bandergirl 3y agoEven if it happens in the browser, the content is being shown on your domain, so good luck explaining that. The fun part: any report will include the content in full, so any report will itself be reportable.
- cnity 3y agoRelated: https://en.wikipedia.org/wiki/Illegal_number https://en.wikipedia.org/wiki/Illegal_number
- vanderZwan 3y agoI did something like this last year (maybe two years ago by now? time flies), but with LZString instead of gzip[0]. The original idea was actually someone else's on Mastodon (who knows, maybe it was OP? I think it was Ramsey Nassr though), but it was just B64 at first - I added the compression. Then someone tried fitting King Lear in there (which worked). Then it turned out that until that day but not for very long after that URLs were not counted for character limits in mastodon toots. That froze quite a few Mastodon clients who were unlucky enough to open that toot for a day or two until that got fixed. Not sure why, I'm guessing (accidentally) quadratic algorithms that weren't counting on urls that were multiple kilobytes in length. [0] https://blindedcyclops.neocities.org/onlinething/writer https://blindedcyclops.neocities.org/onlinething/writer
- v_ignatyev 3y agoLet's see how people in future will trick Neuralink to host websites in others' heads.
- adibalcan 3y agoReally cool
- mixeden 3y agoThis is genious
- giuliomagnifico 3y agoThis is very cool, thanks for sharing!
- ihaveajob 3y agoThis is hilarious, but I think it may have some practical applications. Watch out for hackers though.
- grepfru_it 3y agoI immediately thought this is a great way to ship malicious payloads to an unexpected party. A good WAF would block it as sus, but a few tricks could probably get around that as well
- anamexis 3y agoHow is it different from any webpage in that regard?
- misterbwong 3y agoThe difference is that the contents of this website can be crafted by the attacker directly via the URL without having to do anything to the host.
- anamexis 3y agoHow is that a meaningful attack vector, unique from webpages in general?
- Syntaf 3y ago1. Find existing smol being shared around 2. Modify the parameters to hijack any relevant content 3. Reshare the smol site with your changes under the guise it’s the original link
- anamexis 3y agoThat’s not novel. You could say the same thing for a GitHub Pages page, or a Code Sandbox, or an S3 static site, or really anything. The only reason that would be a threat is if you implicitly trusted smolsite.zip, which would be an odd thing to do.
- MoElmredi 3y agoisn't there a size limit?
- grepfru_it 3y agoYes[0]. Assume 2000 bytes (I believe chrome or safari only supports 2k bytes). RFC states 8000 bytes. Firefox supports 65k bytes. [0] https://stackoverflow.com/questions/417142/what-is-the-maximum-length-of-a-url-in-different-browsers https://stackoverflow.com/questions/417142/what-is-the-maxim...
- MoElmredi 3y agoThank you!
- kristopolous 3y agoAlso known as HTTP Status Code 414
- chrismorgan 3y agoYour citation says Chrome supports 32779 and Safari >64k. I think it’s fair to say that, as a user (disregarding potential search engine aspects), 8000-character URLs are 100% fine these days.
- lagniappe 3y agohow does it react to a zip bomb?
- whoomp12342 3y ago2000 bytes limit
- DriverDaily 3y agoPlenty of room for a recursive function with no base case
- grepfru_it 3y agoYou're not getting very far on 2k bytes. A 10k file expands to 10MB and will likely timeout if the author's webhost configured proper limits
- acidx 3y agoFiles are not decompressed in the server: it sends the unmodified deflate stream back to the user.
- pmarreck 3y agoSee my comment about this upstream, here: https://news.ycombinator.com/item?id=37410473 https://news.ycombinator.com/item?id=37410473
- DriverDaily 3y agoWouldn't infinitely spawning web workers do the same thing as a zip bomb? ``` <script> const workerBlob = new Blob([' while (true) { console.log("this is a worker that will never stop") } '], { type: 'application/javascript' }) const workerBlobURL = URL.createObjectURL(workerBlob) while (true) { new Worker(workerBlobURL) } </script> ```
- stolenmerch 3y agoSee also: https://itty.bitty.site/ https://itty.bitty.site/
- deleted 3y ago[deleted]
- mazokum 3y agoReminded me of a site from the creator of Advent of Code to share solutions of the puzzles (or any plaintext for that matter). https://github.com/topaz/paste https://github.com/topaz/paste
- deleted 3y ago[deleted]
- rswskg 3y agoLiterally designed around XSS
- deleted 3y ago[deleted]
- Minor49er 3y agoNot quite. Some resources don't automatically run https://smolsite.zip/UEsDBBQAAgAIAPtxJlepozjzcAAAAIgAAAAKAAAAaW5kZXguaHRtbD2NSw4CIRAFr4K9F1y4Upi7ILQDmeZj05h4e2dcuKm8pF5S9hRbkE9HlaTQYg8q8nV1gBUWW1D8rqSf8TXz2wHjk3EkUKFVwSoOLnc1mdxxGjdjRvIiyBhjHptes6T50LkZzmHjRvQfuvTrXjC/8BdQSwECHgMUAAIACAD7cSZXqaM483AAAACIAAAACgAAAAAAAAABAAAApIEAAAAAaW5kZXguaHRtbFBLBQYAAAAAAQABADgAAACYAAAAAAA= https://smolsite.zip/UEsDBBQAAgAIAPtxJlepozjzcAAAAIgAAAAKAAA...
- mattbgates 3y agogot me har har
- 4RealFreedom 3y agome too
- halter73 3y agoThe iframe's sandbox attribute is doing a lot of work. I tried to change the parent window location to remove the footer, but the sandbox thwarted me since it didn't include "allow-same-origin". https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe#sandbox https://developer.mozilla.org/en-US/docs/Web/HTML/Element/if... Of course, you can just link directly to the URL the iframe points to. In the case of your video, you can simply visit https://smolsite.zip/s/57fe209faf4e6c0316ad32d7eeb792dfb571edcd/ https://smolsite.zip/s/57fe209faf4e6c0316ad32d7eeb792dfb571e... to have it autoplay while getting rid of the footer. I'm not sure how long the /s/ URL stays around before getting garbage collected by the server, but I bet you could regenerate it by sending a GET request to https://smolsite.zip/UEsDBBQAAgAIAPtxJlepozjzcAAAAIgAAAAKAAAAaW5kZXguaHRtbD2NSw4CIRAFr4K9F1y4Upi7ILQDmeZj05h4e2dcuKm8pF5S9hRbkE9HlaTQYg8q8nV1gBUWW1D8rqSf8TXz2wHjk3EkUKFVwSoOLnc1mdxxGjdjRvIiyBhjHptes6T50LkZzmHjRvQfuvTrXjC/8BdQSwECHgMUAAIACAD7cSZXqaM483AAAACIAAAACgAAAAAAAAABAAAApIEAAAAAaW5kZXguaHRtbFBLBQYAAAAAAQABADgAAACYAAAAAAA= https://smolsite.zip/UEsDBBQAAgAIAPtxJlepozjzcAAAAIgAAAAKAAA... again.
- py4 3y agoPretty cool!
- porsager 3y agoYeah, I had exactly that, but in my opinion better, with fullscreen mode on https://flems.io https://flems.io. Right up until hackers found it was a great place to host their phishing sites...
- acidx 3y agoThat's why we can't have nice things. :(
- mattbgates 3y agoI created a website years ago that let anyone come and just "post" something online anonymously, quick notes or whatever, but have since had to add a registration process and record ip addresses, as the website was overrun by what looked like russian hackers and the dark web in general looking for a place for uh... post links to child... well anyways, took me almost a month to track down all my own website links, as everything was encrypted and growing faster than i could delete it. def sucks to know that even though i took down the means for a place for them to 'conduct business', they will continue to find other websites.
- deleted 3y ago[deleted]
- fouc 3y agoOh so you basically prevent fullscreen mode? Not bad! The average user of flems probably doesn't need fullscreen after all.
- rtcode_io 3y agoWe host the full https://RTCode.io https://RTCode.io playground state in the hash, deploy it to https://RTEdge.net https://RTEdge.net and serve the output at / and the playground at /? - <https://RTEdge.net/ https://RTEdge.net/> output - <https://RTEdge.net/? https://RTEdge.net/?> playground For more information: https://efn.kr https://efn.kr
- pmarreck 3y agowow, this is some interesting web voodoo! What about auth?
- rtcode_io 3y agoAuth is handled in the playground. We offer "Sign in with GitHub, Google, Microsoft, Facebook, and Apple". Anyone can see the code with /? but only the owner(s) can (re-)deploy it. --- There is also service worker support which deploys as a Cloudflare Worker! See <https://sw.rt.ht/? https://sw.rt.ht/?> -> https://sw.rt.ht https://sw.rt.ht
- deleted 3y ago[deleted]
- klntsky 3y agoBase64 is far from being efficient for this use case
- pmarreck 3y agoBase122 or whatever the other option is (and I'm sure there are others), which tries to take advantage of the whole UTF-8 space, and probably wouldn't even work on URLs, is only something like 15% denser. Obviously, you're limited to printable characters, here.
- Ndymium 3y agoCool little project! I did a similar thing recently, I wrote a pastebin that puts the file contents in the URL with brotli. [0] It works quite well, but I'll need to update the syntax highlighting soon as at least Gleam is out of date (boy that language moves fast), and sometimes brotli-wasm throws a memory allocation error for some reason. I guess that's one cool thing that WASM brought to the table, memory handling issues. [0] https://nicd.gitlab.io/t/ https://nicd.gitlab.io/t/
- netcraft 3y agoThis reminds me of this project: http://ephemeralp2p.durazo.us/2bbbf21959178ef2f935e90fc60e5b6e368d27514fe305ca7dcecc32c0134838 http://ephemeralp2p.durazo.us/2bbbf21959178ef2f935e90fc60e5b... Myself and two other people have literally kept this page alive for many years - the github repo says 2017.
- acidx 3y agoOh, this is a cool experiment!
- netcraft 3y agoIts been very interesting over the years. Myself and these other folks have this connection, but no way to communicate or even know who they are.
- sweetjuly 3y agoIt doesn't seem like the client actually verifies that the content it got back matches the SHA256 it requested, so in theory if you really wanted to meet them you could start sending an update website with details to get in contact with you. Though, that'd ruin the magic of it I'd bet :)
- deleted 3y ago[deleted]
- dang 3y agohttps://news.ycombinator.com/item?id=37410630 https://news.ycombinator.com/item?id=37410630 is fun but it's too much of a follow-up* to the current thread. If you get in touch with us at hn@ycombinator.com after some time (say a month or two, to flush the hivemind caches), we'll send you a repost invite. * https://hn.algolia.com/?dateRange=all&page=0&prefix=true&query=follow-up%20downweight&sort=byDate&type=comment https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...
- netcraft 3y ago
- deleted 3y ago[deleted]
- gildas 3y agoAlternatively, when formatted "properly", you can also simply host your zip file. See https://gildas-lormeau.github.io/ https://gildas-lormeau.github.io/ for example.
- deleted 3y ago[deleted]
- matt3210 3y agoSo smol!!
- alpb 3y agoPreviously posted similar work https://news.ycombinator.com/item?id=34312546 https://news.ycombinator.com/item?id=34312546 https://news.ycombinator.com/item?id=2464213 https://news.ycombinator.com/item?id=2464213
- joe5150 3y agoThe comment in the first link about Yahoo embedding a giant b64-encoded JSON object in the URL reminds me of something horrible I did in a previous job. To get around paying our website vendor (think locked-down hosted CMS) for an overpriced event calendar module, I coded a public page that would build a calendar using a base64-encoded basic JSON "events" schema embedded in a "data-events" attribute. Staff would use a non-public page that would pull the existing events data from the public page to prepopulate the calendar builder, which they could then use to edit the calendar and spit out a new code snippet to put on the public page. And so on. It basically worked! But I think they eventually did just fork over the money for the calendar add-on.
- rpastuszak 3y agoCan't find the HN link now, but here's the "Twitter CDN" project I posted a few years back (base64+gzip data URIs): https://sonnet.io/projects#:~:text=Laconic!%20(a%20Twitter%20CDN) https://sonnet.io/projects#:~:text=Laconic!%20(a%20Twitter%2...
- GMoromisato 3y agoI had an idea once to implement Borges's Library of Babel just like this: all the text is in the URL. With more sophisticated encoding, you can optimize English words. Then hook it up to a "search system" so you can search for your own name, clips of text, etc. Eventually you'd hit the URL size limit, of course, but maybe we add a layer on top for curators to bundle sets of URLs together to produce larger texts. Maybe add some LLM magic to generate the bundles. You'd end up with a library that has, not just every book ever written, but every book that could ever be written. [Just kidding, of course: I know this is like saying that Notepad already has every book in existence--you just have to type them in.]
- ossopite 3y agoThis reminds me rather of https://libraryofbabel.info/ https://libraryofbabel.info/
- GMoromisato 3y agoNice! That's exactly what I had in mind. As usual, no idea is unique--it's all about who executes first!
- tintedfireglass 3y agoNo idea is unique, because the library of babel has all of the ideas humans can ever think of ;)
- GMoromisato 3y agolol!
- mk12345 3y agoNice, I had a similar idea a while ago! I wanted to support other media types, such as images, audio and webpages. It was a really fun experiment! https://mkaandorp.github.io/hdd-of-babel/ https://mkaandorp.github.io/hdd-of-babel/
- dmazzoni 3y agoJust in case anyone doesn't already know, you can do that with a data uri as well: data:text/html,<h1>My%20small%20website</h1><p>Look,%20it's%20real!</p> You can use a data uri generator to base64-encode it, if you want. Advantages of smolsite: - Zip might let you fit a bit more than a data uri - Some JS APIs would work on a smolsite url, but wouldn't work in a data uri
- rpastuszak 3y agoI'm using Base64 + gzip (IIRC) which allows me to store ca 5kb of text in a single Tweet: https://sonnet.io/projects#:~:text=Laconic!%20(a%20Twitter%20CDN) https://sonnet.io/projects#:~:text=Laconic!%20(a%20Twitter%2...
- _lvbh 3y agoI use https://github.com/qntm/base2048 https://github.com/qntm/base2048
- rpastuszak 3y agoThis is amazing, thanks
- gvx 3y agoShameless self-promotion: https://github.com/gvx/base116676 https://github.com/gvx/base116676
- pcthrowaway 3y ago> Some JS APIs would work on a smolsite url, but wouldn't work in a data uri In before someone writes a smolsite to install a service worker on the domain that sends analytics for all other smolsites to their own server
- account42 3y agoJust another reason why service workers were a mistake and should be removed.
- geonnave 3y agoOn the subject of weird stuff on a URL, here is a prime dog: https://geonnave.github.io/primg/#179769313486231590772930519078902473361797697894230657273429661642538456588077306078196596037783249291026990862829670919205888565609581869739105202524725614169647793002230079727461396703734603105685474079081886809070115786113168328330817484522518138348888081075292599304124949646601273927687076353436639295493 https://geonnave.github.io/primg/#17976931348623159077293051...
- teacpde 3y agoThis one is amazing, even just the fact that someone thought about representing images with binary format of prime number
- userbinator 3y agoI suspect it was partly inspired by https://en.wikipedia.org/wiki/Illegal_number#Illegal_primes https://en.wikipedia.org/wiki/Illegal_number#Illegal_primes
- dmurray 3y agoThe first version of this I saw came from the webcomic in this reddit thread about a prime number that looks like a giraffe. After one commenter showed off this technique, someone else found a minimal prime giraffe: 7. [0] https://www.reddit.com/r/math/comments/7qpfls/does_there_exist_a_prime_number_whose/ https://www.reddit.com/r/math/comments/7qpfls/does_there_exi...
- geonnave 3y agoprimg is, indeed, inspired by the prime giraffe :)
- ngc6677 3y agoAlso having fun on this subject https://goog.space/ https://goog.space/, trying to add webRTC and yjs, also archive.is for storing a link (and minification). Fun to see so many people are trying things out with URLs, client side web apps, encoding/decoding data
- debarshri 3y agothis is really cool and I think it feel like how show HN should be instead of marketing ploy for other orgs pushing their product.
- mathgeek 3y agoDo you get the impression that novel shows are pushed out by the more corporate ones?
- debarshri 3y agoIf you see here [1], many of them are building by orgs trying to sell some services. They may or may not violate the guidelines though. [1] https://news.ycombinator.com/show https://news.ycombinator.com/show
- hsbauauvhabzb 3y agoI love this type of stuff too, but be aware ycombinator is a start up incubator - people showing off there wares is presumably encouraged, up to a point.
- yellow_lead 3y agoIt is and the leaders of yc even give instructions on how to best do their "launch hn."
- debarshri 3y agoLaunch and Show HN are different I think.
- fouc 3y agoyeah and that's why interesting show HNs get upvoted
- matheusmoreira 3y agoI don't think it qualifies as advertising. People come to Hacker News to see what hackers are working on. It's certainly a major reason why I come here. Every Show HN post I've seen was interesting. Motivated me to start my own projects and polish them so I can show them here. It's a really good feeling when someone else submits your work and you get to talk about it.
- wmab 3y agoSome images are base64 in URLs in Google image search results for their thumbnails. Does anyone have any idea why? Search "Pepsi can" and some when you right click > copy image address will result in "data:image/jpeg;base64,/.../" instead of the website's image. Presumably to limit server cost / make the browser render? It's not for all sites, so perhaps more common sites (Walmart for example) it gives the correct image URL. Pepsi can image from: [1] https://crescentmarket.shop/ https://crescentmarket.shop/ data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2...//9k= [2] But when you click through: https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwXbLGVeQByPHWaFrMHeAcd0XYA5gLHMzHFlZRHXpqqRoSXTRx8bouJBoHiFGxRTpz6VQ&usqp=CAU https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQwXbLG... [3] Paperpunchplus.com shows the correct image URL https://www.paperpunchplus.com/https://cdn3.evostore.io/productimages/vow_premium/l/brt00145.jpg https://www.paperpunchplus.com/https://cdn3.evostore.io/prod...
- jstarfish 3y agoSpecifically for a gallery page of search results, I'd guess that it's to provide a more-consistent experience. When you load that results page, you'd be reaching out to ~100+ different domains that will respond and render the images at different rates (and some will fail to load at all). Base64-encoding lets you shove binary content into caches like Redis, retrieval and embedding of which would be preferable to hotlinking to a slow site. Then most of the page gets rendered at the same time client-side.
- m00dy 3y agowould be useful with url shortener.
- thih9 3y agoYou can use an external one. In which case it would be also your hosting provider.
- Lerc 3y agoNeat https://smolsite.zip/UEsDBBQAAgAIAFtLJ1daaE7RlwIAAN4EAAAKAAAAaW5kZXguaHRtbGVU3W6bMBi931N4rBd24xBI1C1NcKSp2+6qTW1vJoRWBwxYNTYxJk0V5d1nIAS63eDvH75zjgk+fvt59/T713eQm0JsPgTdAUCQM5o0hjULZiiIc6orZohTm3S6dM4pw41gm2DWnaNySQtGnIRVseal4Uo6IFbSMGknOP8X7jl7LZU2o6pXnpicJGzPYzZtHQy45IZTMa1iKhjx+0GCyxegmSBOZd4Eq3LG7KRcs3R4WZvpbAC2KnkDx7NjXRq/ZFrVMll98jxvfU6czmdM5Z5Wo/pSVbzZaUW3lRK1YetLSrDUrLzB1zzL3wWMKsduztoC3/P2+RAtqM64HV8bNQRTLgzTq62oNbwpD6iFStPKQB+BNup7TbhiJacQgbxmU60MNQwu5suEZaOOG7QG77YMZheAglnPfdDgdMavA8FSfTbOqLb09rDuqQYxSVRcF5ZCd1cz/fbIBIuN0tDpGh3UbxS7HcX+7dwbYh0gxPeWl2Az9kBiN2PmrlHHwUBnngyDmnxlqDbkm13WleoVvsvVgIA/ZHNMIBwKpm0Hmvlsgdaa2W+tzFfJC9oQ+0NbVcIanUZTHgiAGmd4iymxgJMNeNbZlsKroz7hq2PWPLbNg57Q8/j19+SemnwceST3bsUlBnfWiFWFwZM1DJVYkDDqK0cNid3A2A16KVw0cXCtKsSDRRhK4mEP78icLfAOd4nHhlPiNKL2B7z6tj6bpqkzqMxSFYZFhMMyilQ6CJuErusKtxL2PsLpgs0RDsPlZ2/SbOdqKhNVQHQ99+xn2G6LK57OvSiK3IKWsCSbsjVgWOIiQmQTlpMCw2JyB3cTUiJ07d5+iRBCo5UKXGKJ5YR4ro/+uZR1z7FV7kWEwaxTrJVw8x/7C1BLAQIeAxQAAgAIAFtLJ1daaE7RlwIAAN4EAAAKAAAAAAAAAAEAAACkgQAAAABpbmRleC5odG1sUEsFBgAAAAABAAEAOAAAAL8CAAAAAA== https://smolsite.zip/UEsDBBQAAgAIAFtLJ1daaE7RlwIAAN4EAAAKAAA...
- 6th 3y agoI love the way the smoke seems to be coming off the top of it. Just a second. I'm late for golf!
- seanthemon 3y agoOf course! Made in Britain
- louthy 3y agoIf it gets out of hand, make sure you know the new number for the security services: 0118999881999119725 ...3 And yes, I have that memorised!
- acidx 3y agoI love this!
- 7ewis 3y agoI was fully expecting to see Rick Astley!
- deleted 3y ago
- madacol 3y agoIf the author decides to use the URL hash instead, he can avoid users sending that zip to his server i.e. https://smolsite.zip/#UEsDBB...
- globalise83 3y agoUse hash and avoid unnecessary work - good advice dude!
- mholt 3y agoI'm guessing the code to read the zip file is server-side, but I guess JS could do it too.
- madacol 3y agoYeah, server-side is much easier to code. But it should be doable with JS I've already built a website that read zip files client-side with JS here: https://madacol.github.io/ozempic-dicom-viewer/ https://madacol.github.io/ozempic-dicom-viewer/ . It will read the zip file and search for MRI/CT scan images to display Where I have doubts is how to reference external files from the main `index.html` file. I know you can load files as blobs and get a URL (I did that in my website above), but I am not sure if that will work as references in the <head>
- acidx 3y agoThen it would require JavaScript and wouldn't be a nice demonstration for my web server library. :)
- madacol 3y agoYou told in another comment that the files are not decompressed on the server. Then if you don't require JS, where is the decompression happening?
- acidx 3y agoOn the client. Data is already stored in the ZIP file deflated, so I can just send whatever is inside the ZIP file back to the client if they accept that encoding (which is pretty much always the case, given how ubiquitous deflate is). The server parses the ZIP file and stores that information in a hash table for quicker lookup but it's otherwise not decompressing anything. This hash table is kept for a few minutes to avoid having to decode the base64-encoded data and parse the ZIP file for every request.
- senseiV 3y agoNice! I remember seeing this for the first time on HN with urlpages, inspired me to build my own version of these https://js-labs.js.org/ https://js-labs.js.org/
- SushiHippie 3y agoNice, reminds me of nopaste [0], which is a pastebin that stores the text in the url compressed with lzma and encoded with base64. [0] https://nopaste.boris.sh/ https://nopaste.boris.sh/
- grimgrin 3y agoexcellent! and my website _is_ already in a zip hehe https://redbean.dev https://redbean.dev
- Theodores 3y agoImaginably this can be done with Brotli too. I like embedding external resources such as bitmap images in SVG in CSS in HTML so that a document is truly portable and can be sent by email or messenger services. So I don't need a URL. The whole document has to be shared, not just a link to it. I also found the favicon can be encoded in this way. I don't do scripts, but a lot of fun can be had with HTML when you start doing unusual things with it. For CSS I also use my own units, just for fun. So no pixels, ems or points, but something else... CSS variables make this possible. I like to use full semantic elements and have minimal classes, styling the elements. This should confuse the front end developer more used to the 'painting by numbers' approach of typical website frontend work.
- Y_Y 3y agoSounds cool, can you link an example?
- Theodores 3y agoSoon... I just work from the HTML specs and go my own way. There is something I am working on that 'needs' this stuff. I see HTML as a creative medium and I wanted to solve problems such as internal document navigation - rather than hundreds of web pages, compile the lot into one. The PWA takes an entirely different approach to what I am trying to do. I like the PWA approach but I want one file that can be moved or emailed, to be available offline. I found that making all the images inline worked for me. I got best results with webp rather than avif but don't care about losing the size benefits with base64 encoding - once zipped those compress nicely.
- rpastuszak 3y agoNice! I did something similar a few years back too! I called it the Twitter CDN™ [1] Here's Pong and The Epic of Gilgamesh, in a Tweet: https://twitter.com/rafalpast/status/1316836397903474688 https://twitter.com/rafalpast/status/1316836397903474688 Here's the editor: https://laconic.sonnet.io/editor.html https://laconic.sonnet.io/editor.html And here's the article explaining how it works: https://laconic-mu.vercel.app/index.html?c=eJylWOuS27YV%2Fu%2BnwDL1WJuK1GXvWknO2nHrbePaE6%2Fr9NcGJCEREUkwACitnPE79AU6fcU%2BQr8DXkTtpZ1OPZkNRQAH53zn9h1OD75%2F%2F%2Frmbx%2FesMRm6fzZtPofY9NE8Jge8JgJy1mUcG2EnXmlXfjnHht0FxNrC1%2F8Wsr1zPvJ%2F3Tlv1ZZwa0MU%2BGxSOVW5Dh5%2FWYm4qXYnbXSpmJ%2BnRXKGNrLTCILMx1U7zvyc56JmbeWYlMobTsiNzK2ySwWaxkJ3%2F3oM5lLK3nqm4inYjbaXRdyI5jleklm3IYpz1e7RWO3zZ2Mfct%2Bq58YC9Wdb%2BQXmS8neNax0D5eXdbrX5%2FVDwRc%2F1lzJN52JBQ8jt3x4WX7bgELSKyYsNF5cbdbSGUu%2FETIZWKxFBzvLvrPskdaZDspGayUOW5kvLSq%2B%2F6ugmnCjofuxL5GC57JdDthVxoI9tlbka6FlRHvM8Nz4xuh5eKB6Qu5LLXoKGXFnfV5KpfQIIKfhL5vRX3ErJedY7Vio%2BHw%2BaMaj4d7NjYgdS1sdQpTFa1%2BLZUVe6507kvFAsfGxR0zKpUx08uQ94Z9Vv8XjA4v7%2BNbn3kM5Hrpvm83tXanw%2BF944NQd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qwaPwn0QgmUGkn3ul6EAEkJV6B60KZRU%2BQHXf3bVAIVQ8fIcYiYzCbZ3qPBn0WKgX234%2FpFBk010WCcpHjgyBVrkXYhEgnzh4iDRzrLla0cVCjwqDaypiKbfxOLFK7XcNztmqelmA7wlkQ3JtAmoyKJ0Z8y%2FDYVXOfkZ7cTOiFkALVl2daI1LHzfEU5UxFPjKJQr5HmvgUFdEaVaQx%2BiqsZhg1Ehm0yGVlESNYcJFFhuHVBgVMi%2F0Vtd1Qzo4qzraxKkV7MDTmYuwURxrVK16QHaeVL%2Bh7lqF0OngfOZqHGFQ3gTXIR0oQvwkUt7AYcEdctMXyBDTzVsd%2FxLQi71VtH2ZSrhcQzXMygJuZEzC37WGZAmKKSCFVFZas66WpfLYwGBYpEyHDxWYDPOP0JM1ZN9WTmk9o4xomYRmLpBnd3%2BuX%2FxHa8%2BQ3CjmWCuMr9y0ykZdF2DYcmaygbm7HeIZvNO02ZyCQqM1ZG3WkXQydCtkefgfzDvR5eSdQ48A7dLcA8EKvs8sGGEBswogHX3AYViX%2BTCvrV82K59g67R8LA9cS%2FED%2BbMaKd3v6yowFY%2Brn66vO73zTs%2BBZjFQzLA0dpvhZ3l%2FBwQat7zXlva8VzOut0bPf1wX287DXix%2Bz3mPXHXw9%2F7mrTWkUjdUC5kMevAVfcCx%2F7VHHZDOWtX1Bq3DCOSuI%2B%2B%2F4bR8Q8yA%3D%3D https://laconic-mu.vercel.app/index.html?c=eJylWOuS27YV%2Fu%... [1] all thanks to the fact that Twitter applies a different char limit to URLs. We wouldn't want to lose those delicious tracking params, would we?
- dspillett 3y agoThat will send the content to the server for unpacking. A slightly more convoluted option might be to put the zip in the anchor part instead and have the response serve code to unpack it from there client side. Though now the server can't scan for damaging content being sent via it, even if it wanted to, as the anchor part does not get sent to the server.
- cnity 3y agoI thought the same thing (though you could do it without anchors as long as the static content server used a glob for routing all traffic to the same web page). It would really simplify hosting.
- klntsky 3y agoWould it be possible to fit webtorrent in?
- mcjiggerlog 3y agoI _kind of_ built something like that a few years ago - https://github.com/tom-james-watson/wtp-ext https://github.com/tom-james-watson/wtp-ext The bad news is it required firefox nightly and honestly I'd be surprised if it even still works because Mozilla laid off the people who were working on libdweb.
- 4RealFreedom 3y agoThis is so much fun! Great idea!
- ShakirWorks 3y agoGod bless internet
- nvr219 3y agogeez allowing the .zip tld was such a bad idea
- Modified3019 3y agoBut can it fit DOOM?
- low_tech_punk 3y agoTake it to the next level, maybe switch from server side zip to browser native gzip? 1. You could achieve this on a static server, like GitHub pages 2. You could make the page editable and auto generate new URLs as the page gets edited. See: https://developer.mozilla.org/en-US/docs/Web/API/Compression_Streams_API https://developer.mozilla.org/en-US/docs/Web/API/Compression...
- low_tech_punk 3y agoIt's got some quine potentials
- meiraleal 3y agoIt is not useless, it is very cool. But the website is hosted at HN server, not in the URL.
- quickthrower2 3y agoI like how it requires sending all the data up to the server, where I guess it gets discarded, returns a static HTML page that converts that same data on the client into a web page. Has the advantages of being centralized (site can be shut down, nuking all URLS) and decentralized (requires tech skills to set up, site cannot be updated without changing URL, etc.). Adding tinyurl to this as suggested in another comment takes it to the next level!
- xxdesmus 3y agoI look forward to the phishinhg. Hopefully you can block known bad hashes.
- lwansbrough 3y agoLike pastebin, but instead of text it’s a 0-day!
- rambambram 3y agoYou didn't only wrote this "silly thing", you also host it on your self-built server? Wow!
- wgx 3y agoMy response in a URL: https://wgx.github.io/anypage/?eyJoMSI6IkhlbGxvIEhOISIsImgyIjoiUmU6IFNtb2xzaXRlIiwiYm9keSI6Ikl04oCZcyB2ZXJ5IGNvb2whIFppcHBpbmcgdGhlIGNvbnRlbnQgaXMgYSBzbWFydCBtb3ZlIEkgbmV2ZXIgdGhvdWdodCBvZiB3aXRoIEFueXBhZ2UgYSBmZXcgeWVhcnMgYmFjay4gS3Vkb3MhIDopIiwiZm9vdGVyIjoiKEFueXBhZ2UgZG9lcyBoYXZlIGEgUVIgZ2VuZXJhdG9yIHRobykifQ== https://wgx.github.io/anypage/?eyJoMSI6IkhlbGxvIEhOISIsImgyI...
- koito17 3y agoCoolest application of those data URL ever. It's amazing how simple this idea is yet I have NEVER considered trying it out. I am not surprised this idea has already been done before, but it's still somehow never crossed my imagination.
- expertentipp 3y agoHow do I get a salaried job doing cool hackery stuff like this?
- matheusmoreira 3y agoLet us know if you find out the answer. Closest I can think of is to try to be so impossibly awesome that you get sponsors at GitHub.
- markburns 3y agoNeeds to support DMCA takedown notices
- Tade0 3y agoI still have control over the domain I bought a few years ago to implement something similar. What ultimately stopped me is that on a site of this type you can't really include links to other sites made the same way, because your URL length is going to balloon.
- adrianomartins 3y agoAmazing! The internet never ceases to surprise.
- high_byte 3y agoyou could save yourself from serving all the websites (and server costs) with just one character! pass the base64 in the hash field by simply prepending # to it. also it seems the URL length limits do not include the hash, so maybe notsosmolsite.zip? ;)
- danpalmer 3y agoThis is a fun hack, nice one. Thinking of reasons to not do this though, it's effectively impossible to content moderate, at least not without building a database of all the content you don't want to host.
- johnnyworker 3y agoMake it purely client side JS and use URL fragments -> host (and receive) nothing.
- danpalmer 3y agoThat's even worse. The issue is not that you have the bytes, it's that users see the content on your site. The less control you have the more difficult it would be to meet legal obligations surrounding user generated content. The deal made years ago in law in the US (and followed around the world) is that websites are not liable for the user generated content that they make available, as long as they remove it if requested for legitimate reasons. These two components go hand in hand. If a website is unable to remove content, it's effectively liable for that content. This basically breaks the web as we know it today.
- resonious 3y agoI see this a lot. Some unsolicited advice: you don't need cat for this kind of command: echo "https://smolsite.zip/`cat somesite.zip | base64 --wrap 0`" can become echo "https://smolsite.zip/`base64 --wrap 0 < somesite.zip`" - Really awesome project nonetheless!
- justusthane 3y agoSee "Useless Use of Cat" for more.
- MattyRad 3y agoVery cool! I have a similar project that uses DNS instead of a path parameter https://serv.from.zone https://serv.from.zone but smolsite is much simpler.
- masukomi 3y agocool. alas, i've got all .zip domains blocked because the vast majority of them are used by malware people trying to trick someone into "downloading a zip file" (this was so predictable)
- SoulMan 3y agoI sometimes use this https://github.com/topaz/paste https://github.com/topaz/paste
- chrisvxd 3y agoAbsolutely useless fun tech demos are the best kind of demos https://github.com/lpereira/lwan https://github.com/lpereira/lwan - presume this is the web server library you're referring to? Very cool.
- deleted 3y ago[deleted]
- acidx 3y agoYes, that's the library! It's something I've been slow cooking for over 10 years at this point. :)
- samarth071003 3y ago[flagged]
- HeavyStorm 3y agoVery cool concept!!
- HeavyStorm 3y agoI can't do it right now, but think of this: we can then create a site that, upon some input, creates a zip file and links to itself, in a possible infinite loop of self generating web sites!