Skip to content

Add code block language #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AioWebSocket是一个遵循 WebSocket 规范的 异步 WebSocket 客户端,相

![images](https://github.com/asyncins/aiowebsocket/blob/master/images/aiowebsocket.jpg)

```
```markdown
Why is it Lighter?
Code volume just 30 KB
Why is it Faster?
Expand All @@ -18,7 +18,7 @@ it is based on asyncio and asynchronous

# Installation

```
```bash
pip install aiowebsocket
```

Expand All @@ -29,7 +29,7 @@ The relationship between WSS and WS is just like HTTPS and HTTP.

Now it can automatically recognize WS and WSS

```
```python
import asyncio
import logging
from datetime import datetime
Expand Down Expand Up @@ -64,7 +64,7 @@ if __name__ == '__main__':

aiowebsocket just build a request header that meets the websocket standard, but some websites need to add additional information so that you can use a custom request header,like this:

```
```python
import asyncio
import logging
from datetime import datetime
Expand Down Expand Up @@ -105,7 +105,7 @@ if __name__ == '__main__':
### union header
Consider: because AIO provides the basic request header, and sometimes does not need to replace all the request headers, but only need to add or replace a field in the request header. So with the union_header parameter added, you can replace or add fields in the request header, such as Origin.

```
```python
import asyncio
import logging
from datetime import datetime
Expand Down Expand Up @@ -141,7 +141,7 @@ With union, the request header information becomes:

`# union_header = {'Origin': 'http://coolaf.com'}`

```
```bash
# before
GET /chat HTTP/1.1
Host: server.example.com
Expand All @@ -150,7 +150,8 @@ Connection: Upgrade
Sec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==
Origin: Python/3.7
```
```

```bash
# after
GET /chat HTTP/1.1
Host: server.example.com
Expand Down