Welcome to my website. I am always posting links to photo albums, art, technology and other creations. Everything that you will see on my numerous personal sites is powered by the formVistaTM Website Management Engine.

icon.linkedin.jpgicon.twitter.jpg

  • Mocking an HTTPS RESTful endpoing with Netcat
    06/12/2019 2:20PM
    Netcat is generally known as a TCP/IP Swiss Army Knife and is incredibly helpful for both debugging and mocking up network services

    Following is an example on how to setup a mock RESTful service that communicates over HTTPS.

    On the "server" side, run the following command.  The -l command instructs Netcat to listen.

    while true; do { echo -e "HTTP/1.1 200 OK\r\n$(date)\r\n\r\n<h1>hello world from $(hostname) on $(date)</h1>" |  nc -vl --ssl 8080; } done

    On the "client" side, run the following to PUT a sample json document.

    curl https://localhost:8080/foo/blah -k -XPUT -d @sample.json
Advanced Search

Categories

Archives