Skip to content

MahdiKheireddine/Websocket-Communication

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Websocket Communication

WebSocket is a protocol for machine-to-machine communication that maintains a TCP connection open for bi-directional passing of information. It enables a connection between two computers, allowing them to send and receive information. The WebSocket protocol can be configured as a server or client. A WebSocket server listens for requests and returns results based on the input. Additionally, the server can also function as a client by sending information without a specific request.

Installation

The websockets package is a Python library for building WebSocket servers and clients. You can install it using pip:

pip install websockets

WebSocket Server

The Python websockets package is built on top of asyncio for handling asynchronous actions from the server as it listens for client requests. Create a simple WebSocket server and run the Python script to start the API. The API listens for a name and returns a greeting.

WebSocket Client

The websockets client sends a name and listens for a return response.

About

Websocket Communication

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages