Help us understand the problem. What is going on with this article?

Mac版のncコマンドでモックアップサーバー

More than 3 years have passed since last update.

MacOS上で、例えばlocalホスト(127.0.0.1)で8000ポートで、スタータスコード200を常に返す場合、以下のコマンドをTerminalで実行する

while : ; do (echo -ne "HTTP/1.0 200 OK\nContent-Length: 0\n\n") | nc -l 127.0.0.1 8000; done

参考リンク
netcat Mac 編
nc コマンドで簡易HTTPサーバ
ncコマンド使い方メモ
nc(netcat)コマンドで覚えておきたい使い方8個

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away