-1

I am trying to make a chat app where one pc connects directly to another. I have encountered an issue with not being able to connect to my laptop from an external network despite forwarding the right port on the router.

I have tried Flask and was able to connect to my laptop from an external network. I guess it does some port forwarding magic.

How can I use Flask to send raw data from client to server and server to client? Is there a code sample for this?

user1581390
  • 1,900
  • 5
  • 25
  • 38

1 Answers1

0

Flask is only useful to develop an application which runs inside a web server. The underlying protocole is HTTP.

What you want is an application which use it own protocol (homemade protocol? or have you found any standard? XMPP?) and can work as client and server. You need a bidirectional protocol. For that, you can use XML-RPC. See xmlrpc package in the Python documentation.

If your PCs don't connect, it may be a firewall configuration problem. Have you opened the right port number? See this question for XMPP.

Community
  • 1
  • 1
Laurent LAPORTE
  • 21,958
  • 6
  • 58
  • 103