TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Web application from scratch, part I

370 点作者 Bogdanp大约 7 年前

12 条评论

ggambetta大约 7 年前
I love seeing projects&#x2F;tutorials like this. Too many developers treat too many layers of the stack as &quot;magic&quot;, and this is great to show it&#x27;s not so.<p>We should change the definition of &quot;full-stack developer&quot; to <i>&quot;given a computer, an opcode reference sheet, a way to enter bytes into a computer, and enough time, is capable of making an operating system and a bunch of applications&quot;</i> :)
评论 #16462871 未加载
评论 #16460678 未加载
评论 #16463647 未加载
评论 #16460896 未加载
评论 #16460772 未加载
评论 #16460869 未加载
评论 #16460773 未加载
评论 #16463546 未加载
评论 #16460659 未加载
评论 #16460813 未加载
评论 #16465671 未加载
r0m4n0大约 7 年前
Couldn’t help but think of this quote...<p>“If you wish to make an apple pie from scratch, you must first invent the universe.” -Carl Sagan
评论 #16464852 未加载
评论 #16471107 未加载
platz大约 7 年前
&gt; we need to create a socket, bind it to an address and then start listening for connections.<p>This is the most important part. Is there a tutorial on sockets, perferably not written from a C perspective and in a language agnostic way? How OS specific is it? Is there a common basis over most OSes?
评论 #16460852 未加载
评论 #16460799 未加载
评论 #16460821 未加载
评论 #16461990 未加载
评论 #16460829 未加载
评论 #16460960 未加载
评论 #16461181 未加载
评论 #16460806 未加载
windlessstorm大约 7 年前
Tried similar stuff few months back. Start a simple socket listening at port 80. Use any browser to make connection. After recieving any connection on server, send a properly formated HTTP response ( precede with 200 ok and must include content-length, everything else I found was optional). Now scale this to include custom root locations. Extending this to handle all the specifications the thousands of common protocols a server should handle will now feel like headache, so here I didn&#x27;t continued anymore.<p>Next I wanted to replace the browser with my own client. Soon realized how huge of a obstacle I was heading towards. Got bogged down by the complexity of a simple browser and still havn&#x27;t got started on this. Maybe someday :D
pvsukale3大约 7 年前
Cache link: <a href="http:&#x2F;&#x2F;webcache.googleusercontent.com&#x2F;search?q=cache:defn.io&#x2F;2018&#x2F;02&#x2F;25&#x2F;web-app-from-scratch-01&#x2F;" rel="nofollow">http:&#x2F;&#x2F;webcache.googleusercontent.com&#x2F;search?q=cache:defn.io...</a>
jventura大约 7 年前
A blog post similar to this one (same content) that I did last year. I use it as basis for a small project on how to implement an http server from scratch in my distributed computing classes: <a href="http:&#x2F;&#x2F;joaoventura.net&#x2F;blog&#x2F;2017&#x2F;python-webserver&#x2F;" rel="nofollow">http:&#x2F;&#x2F;joaoventura.net&#x2F;blog&#x2F;2017&#x2F;python-webserver&#x2F;</a>
kazinator大约 7 年前
Here is a not quite from scratch (uses Apache for CGI dispatch) application:<p><a href="http:&#x2F;&#x2F;www.kylheku.com&#x2F;cgit&#x2F;tamarind&#x2F;tree&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.kylheku.com&#x2F;cgit&#x2F;tamarind&#x2F;tree&#x2F;</a><p>Tamarind allows users to manage throw-away e-mail aliases.<p>I&#x27;ve been using this almost daily for a few years.<p>It&#x27;s self-contained; no framework or external libraries are required other than what is in that directory. It just requires an installation of the TXR language in which it is written.<p>Though it doesn&#x27;t include its own HTTPD server, it&#x27;s in a language that I made myself. The arbitrary boundary defining &quot;from scratch&quot; could easily be moved to encompass &quot;own TCP&#x2F;IP stack and ethernet driver&quot; or &quot;own filesystem&quot;, and so on down to the hardware.
gkya大约 7 年前
I think it&#x27;s useful to know what your abstractions (i.e. the web framework and the web server here) abstract away, so this is really nice material. But for anything you&#x27;re actually going to publish, using a well-founded framework or library is the way to go, because so many things you can get wrong is fixed by many smart people in such projects (i.e. Django, Rails, Nginx, Apache, &amp;c).
评论 #16465885 未加载
hiisukun大约 7 年前
Here is the archive.org mirror, since the server is responding with error 503 (over capacity at the moment).<p><a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20180226040031&#x2F;https:&#x2F;&#x2F;defn.io&#x2F;2018&#x2F;02&#x2F;25&#x2F;web-app-from-scratch-01&#x2F;" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20180226040031&#x2F;https:&#x2F;&#x2F;defn.io&#x2F;2...</a>
评论 #16463637 未加载
bratah大约 7 年前
I get over quota error.
mar77i大约 7 年前
I think you should use .replace(os.linesep, &quot;\r\n&quot;), in case the system&#x27;s newlines coincide with CRLF.
评论 #16464603 未加载
评论 #16464451 未加载
amanzi大约 7 年前
This is interesting, but for an internet facing server I would rather use an existing server that would be far more secure than anything I could create in an afternoon.
评论 #16461106 未加载
评论 #16462654 未加载