首先装一个ncat

yum install ncat
apt get install ncat
whatever...

准备一个html页面文件 data.txt

<html>
        <body>
                <h1>ncat based web server</h1>
                <h1>ncat based web server</h1>
                <h1>ncat based web server</h1>
                <h1>ncat based web server</h1>
                <h1>ncat based web server</h1>
                <h1>ncat based web server</h1>
                <h1>ncat based web server</h1>
        </body>
</html>

开启服务

ncat -lkv 5000 --send-only --sh-exec "echo -e 'cat HTTP/1.1 200 OK\r\n'; cat data.txt"

基于ncat的简易web服务器

相关文章:

  • 2021-10-13
  • 2021-10-29
  • 2021-08-07
  • 2021-06-14
  • 2022-12-23
猜你喜欢
  • 2021-12-17
  • 2021-12-17
  • 2022-01-10
  • 2021-11-23
  • 2021-08-16
  • 2021-12-17
  • 2021-12-02
相关资源
相似解决方案