Skip to main content

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 >= 1.0.0

rapidrsa >= 1.0.0


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


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.1.0.tar.gz (5.8 kB view hashes)

Uploaded Source

Built Distribution

supersockets-0.1.0-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page