Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
I need to implement client/server chat application using pure sockets in Python with many different requirements for such a middleware.
The server should serve a small number of clients and I need to decide which sockets should I use TCP and/or UDP. Also I need to implement a multicast.
You can use python's builtin socket module
You should use TCP sockets for this purpose
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I was working on a decentralized python chat room. I was just wondering, if you don't open up a port, you can't receive messages. But, if you open up a port, you are vulnerable to getting hacked or something. So, is there a way to communicate with Python between a server and a client without opening up ports?
At least one of the client or the server should have an open port (typically, the server). As soon as a TCP connection is established (typically, by the client), a random (= chosen by the operating system) port will be used by the client to be reachable by the server.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
Is there a reason why there is no websocket lib, based on asyncio, in Python core?
It sounds relevant for me as websockets are now a standard, supported by all modern browsers and asyncio is in the good way to be the new standard to handle concurrency un Python.
Note: I do not try to solve any problem, this is only to enrich my general knowledge.
I would say that aiohttp evolves much faster than Python itself: we make several aiohttp releases per year while Python is released every year and half.
That's why aiohttp will never be a part of Python standard library.
Note, the same situation is for requests and other HTTP frameworks like Django.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I was wondering if I can make a PyMongo client that is not localhost such that I can retrieve data from external computers. Is this possible? I read the documentation but there doesn't anything about it.
Yes, it's possible - just use that external computer hostname or IP address instead of localhost.
For example:
import pymongo
client = pymongo.MongoClient("mongodb://10.20.30.40/")
Another example - I have a MongoDB setup with authentication and multiple nodes in a replica set, so I am using
pymongo.MongoClient(
"mongodb://user:password#host1,host2,host3/dbname?replicaSet=rsname",
read_preference=pymongo.ReadPreference.SECONDARY)
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am learning Flask and I want to practice by making simple web app.
I want to make a chat web app that allows sending messages between two or more web browsers in Flask but I am not sure where to start or go about building this application. This question is pretty broad but what I want to know is how to structure this application. What are the pieces I need to build this application.
very broad question, but I'd recommend starting here with web sockets http://blog.miguelgrinberg.com/post/easy-websockets-with-flask-and-gevent . Then you can have two member subscribe to a channel and make messages to each other.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
How can I create a client side database to store information of users on client side. Does anybody know of any tutorials or pointers? Which is the recommended database to use? My client is in .js and uses Django framework.
What you are asking for is called Web Storage and is part of HTML5.
http://diveintohtml5.info/storage.html
http://www.gwtproject.org/doc/latest/DevGuideHtml5Storage.html
However, many times when people SAY they need a client-side database, I ask them the details and it turns out that they don't really need client side storage at all, so proceed with caution.