Socket-Programming-Python | Client Server running code described with comments | Websocket library
kandi X-RAY | Socket-Programming-Python Summary
kandi X-RAY | Socket-Programming-Python Summary
It helps us to connect a client to a server. Client is message sender and receiver and server is just a listener that works on data sent by client.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Queries the server
- Encode data with given key
- Convert a divident to a divisor
- XOR operator
- Decode data using a given key
- Start the server
- Loop forever
- Receive data from socket
- Broadcast message to server
- Create a server socket
- Send a message to a given socket
- Stop the server
- Encode Python data
- Convert data to JSON
- Encode the given data
- Decodes a JSON string
Socket-Programming-Python Key Features
Socket-Programming-Python Examples and Code Snippets
Community Discussions
Trending Discussions on Socket-Programming-Python
QUESTION
I'm new to socket programming. I have developed fundamental/simple client and server application where client successfully communicates with server. Currently, both the server is on my system (local host) and client is also my system.
Now I want to somehow allow clients outside the network ( network where my system belongs to) to communicate with the server but i have no idea what to do and how to proceed. Any help would be appreciated.
Here's a smaple code taken from here
server.py ...ANSWER
Answered 2020-Nov-20 at 18:21You don’t really need to change anything in your code, except for the IP that the client connects to. It needs to be the server PC’s public Internet IP instead of 127.0.0.1
.
If the server PC is connected directly to the Internet modem, then you are done.
Otherwise, if the server PC is behind a router or proxy, then you need to configure port forwarding on that router/proxy to forward traffic from its public WAN IP/port to the server PC’s LAN IP/port. Consult your router/proxy’s documentation for how to do that configuration.
If the router/proxy has uPNP enabled, your server code can dynamically forward the WAN IP/port to itself at runtime. See Python: Open a Listening Port Behind a Router (upnp?)
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Socket-Programming-Python
You can use Socket-Programming-Python like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page