Okay I'm a bit new to network programming. We have a site running over a hosted network with a static IP. We want to send some information to the client's PC who connects or logs into the website. Normal sockets are not working as we're getting an error 'refusing connections'. The sockets work in the same subnet but not over internet. How do we connect to the client's computer via server. Are there any libraries for that? Plus the server needs to serve multiple clients who are connected.
Related
I have created a site that connect ZKTECO K40 device. The connection Method is pretty simple:
from zk import ZK, const
zk = ZK('192.168.1.13', port=4370, timeout=5)
conn = zk.connect()
This makes a connection while running from a local host connecting in the same network.
But after hosting the site, the site is not able to ping to the device and cannot connect to the device.
How can I connect to the device connected on pc local network from a hosted django site? I have my site hosted on Cpanel.
From the server, a machine which is connected to some local network can not be connected. You have to use cams biometric api for communicating your biometric device from the remotely hosted application.
You can use https://www.zerotier.com/ - to expose the device over the internet and then connect it. It's not advisable. but thats one way.
I wrote a Python client/server which I was able to test successfully between two devices on the same network; however, the client fails to connect to the server through the public IP. My hunch is that it's a port forwarding issue in that case. I don't want my users to have to manually port forward to use my program. Is there a pythonic way to add inbound rules to Windows Defender Firewall? Alternatively, is there some other simple example of a client/server in Python that works when connecting via public IP address?
I've been working on a website for the past month, and now its time for me to host the django website onto a private server. Is there a detailed method on how I'm supposed to host the website onto a specific IP address assigned to my system?
This is my first time dealing with hosting a server and i dont know much about it.
Also, once i host it, How do i change the link from being the IP address to an actual link like "12345678.com" or something like that?
(The website should be hosted in such a way that only the people who are in the same network/lan connection should have access to the website.)
I have wamp on the system and the system has a Windows Server OS (if this info helps)
you can run your codes with manage command like this
python manage.py runserver 0.0.0.0:8000
but its strongly recommended to run your code with a web server like nginx or apache read this tutorial to run your site on a linux server
https://www.digitalocean.com/community/tutorials/how-to-set-up-uwsgi-and-nginx-to-serve-python-apps-on-ubuntu-14-04
on windows you can use IIS but its not recommended. its performance is not good
to use 1234567890.com instead of using server ip address you must setup a DNS server on your local network. in linux you can use bind and windows server have its own DNS server. but in your DHCP configuration you must set this DNS server as clients DNS.
Im developing an app using flask framework in python, i wanted to host it on my pc for a few people to be able to visit it, similar to wamps put online feature but for flask instead, i dont want to deploy it to the cloud just yet. how can i do it.
Enable port forwarding on your router, start flask on the 0.0.0.0 address of your computer, set the forwarded port to be the one started on your laptop. This will now allow your LAN and calls to your ISP provided address to be directed to your laptop.
To clarify, LAN can do it without port forwarding in my experience.
We have python application that communicates with Apple Push Notification Service (APNS) for
sending push notifications
gathering information about devices unreachable to push notifications (Feedback Service)
Both cases require opening a socket connection to APNS and
sending a package that contains one or more notifications as a payload
querying the socket for ids of unreachable devices.
While sending works smoothly, it seems that we are unable to receive anything from the opened socket. Has anybody encountered a similar problem with Heroku? On local environment everything works fine.
Unfortunately, Heroku doesn't allow other than HTTP traffic to be handled by your application. It is a common restriction for PaaS services.
There is an addon, however, called Ruppell's Sockets that allows you to receive TCP traffic. Basically what it does is just listens for TCP connections on its own socket and then forwards the data to your application. It is currently in Beta, and I want to warn you that I currently have serious issues with it on my project. The outgoing traffic often doesn't get to a client. So, if possible, deploy somewhere else where you can assure more clear TCP environment.