we created a RTMP server using NGINX and have a camera that is streaming video to that server. We have a python program that should connect to the RTMP server and then display the video on the computer. When we run the program we keep getting the below error:
RTMP_Connect0, failed to connect socket. 110 (Connection timed out)
I found a RTMP url on that was used for testing the code and it works but our RTMP server doesnt. Does anyone know of any settings that need to be set to be able to get passed this error?
Firstly I would check your firewall, TCP port 1935 needs to be open.
Related
I have a problem where the socket client wont connect to the server in python when using ngrok. Only if i run the server before starting the client it works. Also the client wont detect when server looses connection anymore. I think the client detects ngrok as a server without the python server running
I am new to python socket programming and was following a tutorial building a chat-app, using kivy and sockets. I am running my server on my main PC and I was trying to connect from my laptop to this Server, but it doesn't work (Both my PC and laptop are connected via Ethernet cable). When I run the client.py on the PC that I host my Server on, everything works fine.
I tried running the Server on my 0.0.0.0 address and then connecting from my laptop to the IP address that appears on my Server PC if I type in "ipconfig" (192.168.2.x) but it didn't work. I also tried running the server just on the Ethernet-Adapter IP that appears when I type in "ipconfig" (so 192.168.2.x) but this doesn't work neither.
Lastly I have tried defining my Server IP by using the built in socket function: socket.gethostbyname(socket.gethostname()) (weirdly when I run this, my Server runs on my VMware Network Adapter (192.168.66.x) instead of my Ethernet-Adapter). But this too didn't work :(
The client.py code on my laptop always returns this error:
connection error: [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond
Would appreciate any help :)
edit: Could this have something to do with the firewall on my PC blocking connections or something?
Found the Problem! Today it actually worked by disabling my host PCs Windows Defender internal Firewall and the running the Server on 0.0.0.0, which is very weird because yesterday it didn't work...
I have an python flask application that deployed httpd.
And in this application, I am sending syn packet and calculating response time.
I am using scapy to send syn packet.
So Issue is;
Scapy uses raw socket to send packet but raw socket can open by root user :(
So, httpd run as other user and raises exception that "Operation not permitted".
I already tried that,
setcap cap_net_admin,cap_net_raw=eip /usr/sbin/httpd
But still raises exception that 'Operation not permitted'
Best regards..
Instead of using that what you can do is just open up Command line if your on windows as admin and then run the script and it should work fine
I have a web server running on ubuntu instance at Amazon EC2.
My web server is written in Python and supports WebSockets.
My Problem:
I am able to connect to my server through websocket and I am also able send and receive data over websocket. However, after few minutes if I try to send data on same connection from client application I am not receiving anything on server for the same established connection. Now if I close the client application or try to connect through another client application, I am able to connect and communicate again for few minutes only. And after few minutes the new connection again faces the same issue. Please help me to solve the issue.
Of course, when I run the server on my local testing environment the connection never dies and I can communicate over same websocket connection after hours also.
My requirement is to communicate socketio with nodejs server to Raspberry Pi running a local Python app. Please help me. I can find ways of communication with web app on google but is there any way to communicate with Python local app with above mentioned requirements.
It's unclear exactly which part you need help with. To make a socket.io connection work, you do the following:
Run a socket.io server on one of your two computers. Make sure it is listening on a known port (it can share a port with a web server if desired).
On the other computer, get a socket.io client library and use that to make a socket.io connection to the other computer.
Register message handlers on both computers for whatever custom messages you intend to send each way and write the code to process those incoming messages.
Write the code to send messages to the other computer at the appropriate time.
Socket.io client and server libraries exist for both node.js and python so you can either type of library for either type of system.
The important things to understand are that you must have a socket.io server up and running. The other endpoint then must connect to that server. Once the connection is up and running, you can then send message from either end to the other end.
For example, you could set up a socket.io server on node.js. Then, use a socket.io client library for python to make a socket.io connection to the node.js server. Then, once the connection is up and running, you are free to send messages from either end to the other and, if you have, message handlers listening for those specific messages, they will be received by the other end.