Coder Social home page Coder Social logo

socket-lab's Introduction

编写一个Web服务器软件,要求如下:

  • 可配置Web服务器的监听地址、监听端口和主目录

  • 能够单线程处理一个请求。当一个客户(浏览器,输入URL:http://202.103.2.3/index.html)连接时创建一个连接套接字;

  • 从连接套接字接收http请求报文,并根据请求报文的确定用户请求的网页文件

  • 从服务器的文件系统获得请求的文件。创建一个由请求的文件组成的http响应报文

  • 经TCP连接向请求的浏览器发送响应,浏览器可以正确显示网页的内容

  • 服务器可以启动和关闭

  • 能够传输包含多媒体(如图片)的网页给客户端,并能在客户端正确显示;

  • 在服务器端的屏幕上输出请求的来源(IP地址、端口号和HTTP请求命令行)

  • 在服务器端的屏幕上能够输出对每一个请求处理的结果

  • 对于无法成功定位文件的请求,根据错误原因,作相应错误提示,并具备一定的异常处理能力

socket-lab's People

Contributors

lyfzero avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.