Files
tldr/pages.zh/common/simplehttpserver.md

25 lines
1.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# simplehttpserver
> 一个简单的HTTP/S服务器支持文件上传、基本身份验证以及用于自定义响应的YAML规则。
> Go语言对Python的`http.server`的替代方案。
> 更多信息请访问:<https://github.com/projectdiscovery/simplehttpserver>。
- 启动HTTP服务器提供当前目录的服务并输出详细信息默认在所有接口上监听端口8000
`simplehttpserver -verbose`
- 启动HTTP服务器使用基本身份验证在所有接口的80端口提供特定路径的服务
`sudo simplehttpserver -basic-auth {{username}}:{{password}} -path {{/var/www/html}} -listen 0.0.0.0:80`
- 启动HTTP服务器使用自签名证书启用HTTPS并在所有接口上自定义SAN
`sudo simplehttpserver -https -domain {{*.selfsigned.com}} -listen 0.0.0.0:443`
- 启动HTTP服务器支持自定义响应头和上传功能
`simplehttpserver -upload -header '{{X-Powered-By: Go}}' -header '{{Server: SimpleHTTPServer}}'`
- 启动HTTP服务器使用YAML中的自定义规则请参阅文档以获取DSL
`simplehttpserver -rules {{rules.yaml}}`