Você pode usar o netcat. Algo como:
nc -l 34331
Se você quiser ver os detalhes de uma chamada, seria mais fácil usar a opção -v
de curl e chamar o serviço real.
curl -v http://www.google.com > /dev/null
* Connected to localhost (127.0.0.1) port 3128 (#0)
> GET http://www.google.com/ HTTP/1.1
> Host: www.google.com
> User-Agent: curl/7.47.0
> Accept: */*
> Proxy-Connection: Keep-Alive
>
< HTTP/1.1 200 OK
< Date: Fri, 22 Jun 2018 12:58:58 GMT
< Expires: -1
< Cache-Control: private, max-age=0
< P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
< Server: gws
< X-XSS-Protection: 1; mode=block
< X-Frame-Options: SAMEORIGIN
< Set-Cookie: 1P_JAR=2018-06-22-12; expires=Sun, 22-Jul-2018 12:58:58 GMT; path=/; domain=.google.com
< Set-Cookie: NID=132=cLF8pa3SHRsg32-ZGzN5aZ3ipLfAbxqfmUvJ2NTvkYg2eWN6XaOqSofMK7o902-C9hdxL_wUn6cJW2AkngcQXvNUKCCdNi7Z-eBTu0Yc8-iTFR90OeZDR44hxZK95_Ny; expires=Sat, 22-Dec-2018 12:58:58 GMT; path=/; domain=.google.com; HttpOnly
< Accept-Ranges: none
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: text/html; charset=ISO-8859-1
< Connection: keep-alive
< Proxy-Connection: keep-alive
<
{ [2035 bytes data]
100 11564 0 11564 0 0 69134 0 --:--:-- --:--:-- --:--:-- 68833
* Connection #0 to host localhost left intact