Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/codophobia/network-communication-protocols
Code examples in Python to understand popular network communication protocols like TCP, HTTP and RPC
https://github.com/codophobia/network-communication-protocols
http learning-by-doing python rpc tcp
Last synced: 14 days ago
JSON representation
Code examples in Python to understand popular network communication protocols like TCP, HTTP and RPC
- Host: GitHub
- URL: https://github.com/codophobia/network-communication-protocols
- Owner: codophobia
- License: mit
- Created: 2024-01-28T18:15:50.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-02-22T08:04:23.000Z (12 months ago)
- Last Synced: 2024-11-19T01:53:56.315Z (3 months ago)
- Topics: http, learning-by-doing, python, rpc, tcp
- Language: Python
- Homepage: https://medium.com/@shivammitra/part-1-exploring-network-communication-from-local-functions-to-tcp-http-and-rpc-93ee5c27a2df
- Size: 18.6 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Popular network communication protocols
[![lint](https://github.com/codophobia/Network-communication-protocols/actions/workflows/lint.yaml/badge.svg)](https://github.com/codophobia/Network-communication-protocols/actions/workflows/lint.yaml) [![test](https://github.com/codophobia/Network-communication-protocols/actions/workflows/test.yaml/badge.svg)](https://github.com/codophobia/Network-communication-protocols/actions/workflows/test.yaml) ![GitHub License](https://img.shields.io/github/license/codophobia/Network-communication-protocols) ![GitHub top language](https://img.shields.io/github/languages/top/codophobia/Network-communication-protocols)
Code examples in Python to understand popular network communication protocols like TCP, HTTP and RPC
## Set up
```
git clone https://github.com/codophobia/rest-vs-rpc.git
cd rest-vs-rpc
python3 -m pip install virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
```## Running RPC client and server
```
python rpc/server.py
```
In another terminal, run the client.
```
python rpc/python_client.py
```
Generate client stubs
```
python -m grpc_tools.protoc --proto_path=rpc/proto --python_out=rpc/proto/gen/py --pyi_out=rpc/proto/gen/py --grpc_python_out=rpc/proto/gen/py rpc/proto/calculator.proto
```## Running REST client and server
```
python rest/server.py
```
In another terminal, run the client.
```
python rest/python_client.py
```## Running Socket client and server
```
python socket/server.py
```
In another terminal, run the client.
```
python socket/python_client.py
```