5
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?

mrubyでHTTPサーバー

5
Last updated at Posted at 2025-12-03

mruby on YABMにHTTPサーバー機能を付けてみました。

lwipのraw apiのサンプルのechoサーバーをベースにして作りました。

メソッドは初期化とバインドとレスポンスの設定、リクエストヘッダーの取得の4つだけです。

リクエストしてみます。

% curl http://10.0.1.111:8080
<html><head><title>Congrats!</title></head><body><h1>Welcome to our mruby on YABM HTTP server!</h1><p>This is a small test page, served by LwIP raw method.</body></html>

ターゲットのコンソールには以下のように出ます。

GET / HTTP/1.1
Host: 10.0.1.111:8080
User-Agent: curl/8.10.1
Accept: */*

今のところ、非同期で設定したレスポンスを返してヘッダーを拾えるだけの機能になります。

すべてのmruby on YABMで利用可能です。

5
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
5
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?