⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme .txt~

📁 用java编写的http的client和server程序
💻 TXT~
字号:
Assuming that the exercise files was in the directory  /handout.

1. How to run the Client?

   Run the Client classs with the following command:

    java Client  <hostname>
    When the class is running, a promot will apears: 
    "<hostname> is listening to your request:"
    Then we can use the GET command to get files from the server.
    The following is an example: 

     javac Client.java
     java Client www.baidu.com
     GET /index.htm  HTTP/1.0

     Then the respond information is output. 
      we input the file name to save the request file data.
      
      Then we can open the file in the same directory  as the .class file, i.e. /handout.

2.  How to run the Server ?

     Using the following command to run the Server class

      javac Server.java
     "java Server"

     Then a promot will appear: 
     "The server is now waiting for request..."

     Then we open a Web Browser and input the following 

     http://localhost:8000/index.html

     It must be point out that index.html is a file in the /handout directory  as the Server.class
    
     Then we can see the web page.
     
     we can also get a  .jpg or .gif file via the web browser. As it is the same as getting the .html files.


3.   How to run the ThreadedServer?

     The use of the ThreadedServer is almost the same as the the Server, except that the ThreadedServer can accept multiple request at the same time.


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -