@@ -61,6 +61,7 @@ This will display help for the tool. Here are all the switches it supports.
6161| ` -max-file-size ` | Max Upload File Size (default 50 MB) | ` simplehttpserver -max-file-size 100 ` |
6262| ` -sandbox ` | Enable sandbox mode | ` simplehttpserver -sandbox ` |
6363| ` -https ` | Enable HTTPS in case of http server | ` simplehttpserver -https ` |
64+ | ` -http1 ` | Enable only HTTP1 | ` simplehttpserver -http1 ` |
6465| ` -cert ` | HTTPS/TLS certificate (self generated if not specified) | ` simplehttpserver -cert cert.pem ` |
6566| ` -key ` | HTTPS/TLS certificate private key | ` simplehttpserver -key cert.key ` |
6667| ` -domain ` | Domain name to use for the self-generated certificate | ` simplehttpserver -domain projectdiscovery.io ` |
@@ -128,7 +129,9 @@ simplehttpserver -rule rules.yaml -tcp -tls -domain localhost
128129The rules are written as follows:
129130``` yaml
130131rules :
131- - match : regex
132+ - match : regex-match
133+ match-contains : literal-match
134+ name : rule-name
132135 response : response data
133136` ` `
134137
@@ -137,6 +140,7 @@ For example to handle two different paths simulating an HTTP server or SMTP comm
137140rules :
138141 # HTTP Requests
139142 - match : GET /path1
143+ name : redirect
140144 response : |
141145 HTTP/1.0 200 OK
142146 Server: httpd/2.0
@@ -149,13 +153,15 @@ rules:
149153 <HTML><HEAD><script>top.location.href='/Main_Login.asp';</script>
150154 </HEAD></HTML>
151155 - match : GET /path2
156+ name : " 404"
152157 response : |
153158 HTTP/1.0 404 OK
154159 Server: httpd/2.0
155160
156161 <HTML><HEAD></HEAD><BODY>Not found</BODY></HTML>
157162 # SMTP Commands
158163 - match : " EHLO example.com"
164+ name : smtp
159165 response : |
160166 250-localhost Nice to meet you, [127.0.0.1]
161167 250-PIPELINING
@@ -167,6 +173,14 @@ rules:
167173 response : 250 Accepted
168174 - match : " RCPT TO: <test@example.com>"
169175 response : 250 Accepted
176+
177+ - match-contains : !!binary |
178+ MAwCAQFgBwIBAwQAgAA=
179+ name : " ldap"
180+ # Request: 300c 0201 0160 0702 0103 0400 8000 0....`........
181+ # Response: 300c 0201 0161 070a 0100 0400 0400 0....a........
182+ response : !!binary |
183+ MAwCAQFhBwoBAAQABAA=
170184` ` `
171185
172186## Note
0 commit comments