Easy to use implementation of the built in 'socket' library
Project description
SuperSockets
Easy to use implementation of python3's built in 'socket' library
Example Use
Server Configuration
''' file: example_server.py '''
from supersockets import server
#Create connection
s = server(ip="0.0.0.0", port=11000, RSA=True)
s.send("Can you here me?")
print(s.recv())
''' Output '''
~$ python3 example_server.py
Loud and clear!
Client Configuration
'''file: example_client.py '''
from supersockets import client
#Connect to server
c = client(ip="0.0.0.0", port=11000)
print(c.recv())
c.send("Loud and clear!")
''' Output '''
~$ python3 example_client.py
Can you here me?
Required Dependences From PyPi
pycryptodome >= 3.15.0
listcrypt >= 0.2.5
rapidrsa >= 0.0.7
Documentation
'''
Module to simplify the process of creating servers and clients, with seamless built in encryption options
Classes:
server()
Used to create a server connection that the client class can interact
with using the send() and recv() methods.
__init__(self, ip:str, port:int, key=None, RSA=False, socket_timeout=.5)
Methods:
create_secure_connection(self, rsa_enabled: bool) -> bool
Uses RSA cryptography to automatically share a key between the server and client,
for use in symmetric encryption for any future messages
send(self, data: any) -> bool
Sends the data
recv() -> any
Ensures successful receival of data sent from the 'send' method
__del__(self) -> bool
Automatically closes the connection between the
client and server upon the programs end.
client(server)
Used to connect to an active server created by the server class,
interactions can be made using the send() and recv() methods.
__init__(self, ip:str, port:int, key=None, socket_timeout=.5)
Methods:
create_secure_connection(self) -> bool:
Uses RSA cryptography to share a symmetric key between the server and client,
for use in symmetric encryption for future messages
Inherits:
send, recv, __del__
'''
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
supersockets-0.0.8.tar.gz
(5.9 kB
view details)
Built Distribution
File details
Details for the file supersockets-0.0.8.tar.gz
.
File metadata
- Download URL: supersockets-0.0.8.tar.gz
- Upload date:
- Size: 5.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ce281ca08c536c7029c3025309f0af500a971f069ab5dd2e6010a1e6b859393 |
|
MD5 | bef2a3713d00351a4ae5e7645bfabc44 |
|
BLAKE2b-256 | 57ef5418f0a0dc3776b06454b3ad9b476b18a2bd32a16f064cc5a69a412817bc |
File details
Details for the file supersockets-0.0.8-py3-none-any.whl
.
File metadata
- Download URL: supersockets-0.0.8-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.6.0 importlib_metadata/4.8.1 pkginfo/1.8.3 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eed7bfe29a5bd627e2317d978fccea9f6fd84e77332a122b5cfa5c44f9696864 |
|
MD5 | f75f113a46ccba635b432eea215c6b96 |
|
BLAKE2b-256 | 5bf09477afdb391cb9e1df76014957aa4e428aa8ab42fd3c36aadab52ac2bf1c |