Examples

Welcome to the examples! These show off warp's functionality and explain how to use it.

Getting Started

To get started, run examples/hello.rs with:

> cargo run --example hello

This will start a simple "hello world" service running on your localhost port 3030.

Open another terminal and run:

> curl http://localhost:3030/hi
Hello, World!%

Congratulations, you have just run your first warp service!

You can run other examples with cargo run --example [example name]:

Further Use Cases

Serving HTML and Other Files

Websockets

Hooray! warp also includes built-in support for WebSockets

Server-Side Events

TLS

  • tls.rs - can i haz security?

Autoreloading

  • autoreload.rs - Change some code and watch the server reload automatically!

Debugging

Custom HTTP Methods

Other

Copyright © 2025 • Created with ❤️ by the authors of warp and Gabor Szabo