Skip to content

Commit a1fad1d

Browse files
committed
rewrite introduction documentation
1 parent 2818dbe commit a1fad1d

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

README.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ hello_world_echo_message = receive(do: (message -> message))
3636
{:ok, websocket, [{:text, "hello world"}]} = Mint.WebSocket.decode(websocket, data)
3737
```
3838

39-
## What is Mint?
39+
Check out some [examples](./examples) and the online
40+
[documentation](https://hexdocs.pm/mint_web_socket/Mint.WebSocket.html).
4041

41-
Mint is a _functional_ HTTP/1 and HTTP/2 client library written in Elixir.
42+
## Functional WebSockets
4243

43-
Why does it matter that it's functional? Isn't Elixir functional?
44-
45-
Existing WebSocket implementations like
44+
Mint.WebSocket (like Mint) takes a _functional_ approach to HTTP and
45+
WebSockets. Existing WebSocket implementations like
4646
[`:gun`](https://github.com/ninenines/gun) /
4747
[`:websocket_client`](https://github.com/jeremyong/websocket_client) /
4848
[`Socket`](https://github.com/meh/elixir-socket) /
@@ -52,12 +52,13 @@ Elixir and Erlang, but it does not allow the author much control over
5252
the WebSocket connection.
5353

5454
Instead `Mint.WebSocket` is process-less: the entire HTTP and WebSocket
55-
states are kept in immutable data structures. This enables authors of
56-
WebSocket clients a more fine-grained control over the connections:
57-
`Mint.WebSocket` does not prescribe a process archicture.
55+
states are kept in immutable data structures. When you implement a WebSocket
56+
client with `Mint.WebSocket`, runtime behavior and process architecture
57+
are up to you: you decide how to handle things like reconnection or retry
58+
and how to deal with failures.
5859

59-
For more information, check out
60-
[Mint#Usage](https://github.com/elixir-mint/mint#usage).
60+
For a practical introduction, check out Mint's
61+
[usage documentation](https://github.com/elixir-mint/mint#usage).
6162

6263
## Spec conformance
6364

@@ -70,11 +71,11 @@ produced by the Autobahn|Testsuite is uploaded on each push to main.
7071

7172
See the report here: https://nfibrokerage.github.io/mint_web_socket/
7273

73-
## A Quick Note About HTTP/2
74+
## HTTP/2 Support
7475

75-
HTTP/2 WebSockets are not a built-in feature of HTTP/2. RFC8441 is an extension
76+
HTTP/2 WebSockets are not a built-in feature of HTTP/2: RFC8441 is an extension
7677
to the HTTP/2 protocol and server libraries are not obligated to implement it.
77-
In the current landscape, very few server libraries support the HTTP/2
78+
In the current landscape, very few server libraries support the RFC8441's
7879
extended CONNECT method which bootstraps WebSockets.
7980

8081
If `Mint.WebSocket.upgrade/4` returns
@@ -88,9 +89,12 @@ enabled.
8889

8990
## Development workflow
9091

91-
Interested in developing `Mint.WebSocket`? The `docker-compose.yml` sets up
92-
an Elixir container, a simple websocket echo server, and the Autobahn|Testsuite
93-
fuzzing server.
92+
Contributions are very welcome!
93+
94+
If you're Interested in developing `Mint.WebSocket`, you'll need docker-compose
95+
to run the fuzzing test suite. The `docker-compose.yml` sets up an Elixir
96+
container, a simple websocket echo server, and the Autobahn|Testsuite fuzzing
97+
server.
9498

9599
```
96100
(host)$ docker-compose up -d

0 commit comments

Comments
 (0)