simplehttpserver icon indicating copy to clipboard operation
simplehttpserver copied to clipboard

[INF] Closing connection: no matched rule, Change behaviour to a custom default response

Open brenocss opened this issue 2 years ago • 0 comments

Please describe your feature request:

Now: [INF] Closing connection: no matched rule Expected: simple http response like interact sh

Describe the use case of this feature:

Currently, the simplehttp server in TCP mode accepts rules. However, when no rule is matched, it would be nice to have a way to customize the rules for a no-match scenario. For example:

rules:
  # HTTP Requests
  - default-http:
    name: default-http
    response: |
              HTTP/1.1 200 OK
              Content-Type: text/html; charset=utf-8
              Server: simplehttpserver
              simplehttpserver: 1.1.2
              Content-Length: 72
              Connection: close

              <html><head></head><body>{{randomString}}</body></html>

brenocss avatar Mar 23 '23 22:03 brenocss