Skip to content

Comment on Show HN: Running a simple local HTTP server in a web page

Comments

I may be missing the point, but HTTP is a communication protocol. This looks like a file explorer and editor.

It is using HTTP, just doing it through browser APIs[0][1] so in this case the server layer is the service worker but it's still happening through HTTP means. So the client and the server are both running in the browser, the only difference is that this "virtual" server can only be accessed by the same browser session. They are very powerful APIs as you can intercept the network layer and do all sorts of hacks, like the OP's project.

[0]: https://developer.mozilla.org/en-US/docs/Web/API/Response

[1]: https://developer.mozilla.org/en-US/docs/Web/API/Service_Wor...

Not the same. Disk files can be browsed via HTTP (HTTPS), so you can preview a local static site directly, without tools such as http-server, SimpleHTTPServer, etc.

Service worker file loader != HTTP server. You are intercepting requests which are usually fulfilled by HTTP, but you are not implementing or interacting with HTTP.

Even so, cool project.

If the files are served via HTTP I am missing it. A page which is fetched via HTTP and then accesses local files is not an HTTP server.

https://en.m.wikipedia.org/wiki/Hypertext_Transfer_Protocol

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.