Skip to content

Instantly share code, notes, and snippets.

@masakielastic
masakielastic / Cargo.toml
Last active June 16, 2025 15:59
Rust の tokio で TCP + TLS サーバー
[package]
name = "tokio-tls-tutorial"
version = "0.1.0"
edition = "2021"
[dependencies]
tokio = { version = "1.45", features = ["full"] }
tokio-rustls = "0.26"
rustls = "0.23"
rustls-pemfile = "2.1"
@masakielastic
masakielastic / Cargo.toml
Last active June 16, 2025 13:33
Rust の tokio で TCP サーバー
[package]
name = "tcp_server"
version = "0.1.0"
edition = "2021"
[dependencies]
tokio = { version = "1.0", features = ["full"] }
@masakielastic
masakielastic / Cargo.toml
Last active June 16, 2025 10:51
Rust HTTP/1 サーバー + php-fpm
[package]
name = "fastcgi"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = "0.8.4"
fastcgi-client = "0.9"
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1", features = ["full"] }
@masakielastic
masakielastic / README.md
Last active June 16, 2025 01:46
Go で FastCGI サーバー

Go で FastCGI サーバー

Go のプログラムを実行して FCGI サーバーを起動させます。

go run main.go

ターミナルに次のメッセージが表示されます。

@masakielastic
masakielastic / README.md
Last active June 16, 2025 00:07
node-fastcgi で FCGI サーバー

node-fastcgi で FCGI サーバー

パッケージをインストールします。

npm install node-fastcgi

FastCGI サーバーを起動させます。

@masakielastic
masakielastic / Cargo.toml
Last active June 14, 2025 13:00
Rust で php-fpm と通信する
[package]
name = "fastcgi"
version = "0.1.0"
edition = "2021"
[dependencies]
fastcgi-client = "0.9"
tokio = { version = "1", features = ["full"] }
@masakielastic
masakielastic / Cargo.toml
Last active June 14, 2025 10:25
Rust で FastCGI クライアントを作る(spawn-fcgi によるデーモンと通信)
[package]
name = "fastcgi"
version = "0.1.0"
edition = "2021"
[dependencies]
fastcgi-client = "0.9"
tokio = { version = "1", features = ["full"] }
@masakielastic
masakielastic / Cargo.toml
Last active June 22, 2025 18:45
axum HTTP/1 サーバーで HTML を表示する(tower_http 使用)
[package]
name = "axum-static"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = "0.8.4"
tokio = { version = "1.0", features = ["full"] }
tower-http = { version = "0.6", features = ["fs"] }
@masakielastic
masakielastic / Cargo.toml
Last active June 14, 2025 05:25
axum HTTP/1 サーバーで静的ファイルの表示(tower_http を使用)
[package]
name = "axum_o3"
version = "0.1.0"
edition = "2021"
[dependencies]
axum = "0.8.4"
tokio = { version = "1", features = ["full"] }
tower-http = { version = "0.6", features = ["fs"] }
anyhow = "1"
@masakielastic
masakielastic / Cargo.toml
Last active June 16, 2025 11:02
Rust の hyper + tokio で HTTPS + HTTP/2 サーバー
[package]
name = "http_server_min"
version = "0.1.0"
edition = "2021"
build = "build.rs"
[dependencies]
hyper = { version = "1", features = ["full"] }
hyper-util = { version = "0.1", features = ["tokio", "server", "http1", "http2"] }
tokio = { version = "1", features = ["full"] }