mvisonneau / gitlab-ci-pipelines-exporter

Prometheus / OpenMetrics exporter for GitLab CI pipelines insights
Apache License 2.0
1.25k stars 237 forks source link

How to close tcp connection by Imposter #698

Closed khmel-aleh closed 1 year ago

khmel-aleh commented 1 year ago

I have a service that closes the connection after a response.

➜  ~ telnet my_server 18401
Trying 10.130.0.28...
Connected to my_server.
Escape character is '^]'.
hello
world!Connection closed by foreign host.

I need to do the same with mountebank But when I create a stub

{
  "responses": [
    {
      "is": {
        "data": "d29ybGQh"
      }
    }
  ],
  "predicates": [
    {
      "contains": {
        "data": "aGVsbG8="
      }
    }
  ]
}

and send request the connection stays open

➜  ~ telnet localhost 5555
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
hello
world!\hello
world!hello
world!^]
telnet> close
Connection closed.

How to tell the imposter to close connection?