2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

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

Posted at

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個

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?