爱意满满的作品展示区。
Wincer
1.3D

基于 Socket 写了一个简易的 HTTP 服务器

  •  
  •   Wincer ·
    WincerChan · Aug 3, 2018 · 4285 views
    This topic created in 2871 days ago, the information mentioned may be changed or developed.

    最近复习 HTTP 协议,刚好发现 Python 标准库自带的 HTTP 服务器不支持并发,就拿 Socket 写了一个练练手,分别用 Thread 和 asyncio 实现了并发,大佬们轻喷😂

    👉项目地址

    7 replies    2018-08-09 06:40:06 +08:00
    go2sleep
        1
    go2sleep  
       Aug 3, 2018 via iPhone
    感谢楼主分享。
    我一直在用 aiohttp 感觉很好用,性能也很好。楼主可以了解一下。
    shuizhengqi
        2
    shuizhengqi  
       Aug 3, 2018
    这么多人喜欢写 http 服务器
    takato
        3
    takato  
       Aug 3, 2018
    aiohttp+uvloop,值得拥有。
    InternetExplorer
        4
    InternetExplorer  
       Aug 3, 2018
    @shuizhengqi #2 看上去简单咯

    楼主加油
    Wincer
        5
    Wincer  
    OP
       Aug 3, 2018
    @go2sleep 我也用过 aiohttp,不过是在写异步爬虫的时候,确实很好用
    @shuizhengqi 简单的项目容易练练手😂
    @takato 只是学习的时候造的一个轮子啦,真正到项目的时候肯定还是该上框架就上框架了
    @InternetExplorer 谢谢,你也加油
    ICKelin
        6
    ICKelin  
       Aug 8, 2018 via iPhone
    我想起我大三的时候用 c 写的 http 服务器……那时真能折腾啊,还基于它写了个网页版扫雷……
    Wincer
        7
    Wincer  
    OP
       Aug 9, 2018 via Android
    @ICKelin 好久没写 c 了 接触了 python 后就不想再接触其它语言了😂
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2902 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 14:41 · PVG 22:41 · LAX 07:41 · JFK 10:41
    ♥ Do have faith in what you're doing.