I bought an IP-Camera which normally uses an mobile app to establish the first connection. The camera provides a WLAN I can log into using the standard password written on the camera. Now I want to connect to the Camera/Router. I found out the IP address which is 10.10.10.1 and the only open port is 5566 and it is UDPplus. I cannot open up a connection in the browser using 10.10.10.1:5566. Is the camera connection somehow broken so I should return it or is there a different way to establish a connection to an UDPplus port?
AFAIK there's no way to access a UDP port by default
Related
I have NodeJs web service in based web socket. One of my file by the server side tries send xml to printer in local area network on ip address 192.168.1.5 but this ip is in my physical network not in area network by server side. When I open the web service on localhost it's work but when I open my service via network it's not work. How can I use web socket that nodejs app will send xml via TCP to another localhost in local area network using socket client just like me?
for example (my local area network):
localhost - 192.168.1.100
printer - 192.168.1.5
localhost (my physical computer) -> opening web service (NodeJS) on browser -> running script (service) -> sending xml via TCP to printer (192.168.1.5)
is this scenario possible?
You can't directly use webSocket or socket.io to send a plain TCP packet. webocket is its own protocol and socket.io runs on top of webSocket. It initiates a connection with an http request, uses it's own data format framing and its own security scheme. As such a webSocket client can only connect to a webSocket server or a socket.io client to a socket.io server, not to a plain TCP device.
You can use the Net module in node.js to make plain TCP connections. So, you can contact the printer directly from node.js if that would work.
But, you can't make plain TCP connections directly form a browser web page without using some sort of browser plug-in that has access to native code or without sending some sort of http or webSocket or socket.io request to a server and having the server contact the printer on your behalf (which would require server and printer to be on the same local network).
I want make my server only accept one connection from a device(that means people can not open several browsers to connect my server), and I use client ip to identify connections. The question is if two devices are from the same ethernet their ip address will be the same(so they can not connect to my server the same time).
I tried to use socket.request.connection.remotePort to get the client port, but it shows different every connection even in the same browser.
I have a Master server machine (windows 10), which I'm using to control several Raspberry PIs using TCP in node js.
I'm wondering what would be the best way to send the hostname of each pi (pi-001.local, pi002.local, pi003.local etc...) to the server.
running socket.remoteAddress on the Server returns the IP of the client, but what I need the Hostname
Obviously each pi can resolve its own hostname using the os.hostname() method
but I need to keep track and know what hostname each net.Socket object is associated with on the Server side.
Is there any better way than just sending it via socket.write(os.hostname()) ?
thanks!
As long as the DNS server used by the TCP server knows about the hostnames of the PI devices, you could just have the TCP server do a reverse lookup of socket.remoteAddress for each connection. You can do this reverse lookup in node with dns.reverse().
This is already somewhat done in the SMTP protocol, which is a good model to use for TCP negotiation. Using that type of approach, the first thing your Pi's would do when they connect to the server is write a
HELO pi00001.local
... that way your server always expects the information up-front from the Pi with each connection or reconnect.
I have a port 12345 on a client PC, connected to a switch, connected to Server 2008, connected to Uverse Modem/Router for internet.
I need to allow incoming requests to that port (forward/open).
I have the port number open on both the router and the server but it's still not allowing connections.
If the client is connected directly to the router then the port is open but cannot figure the block when connected thru the server. HELP Please
Thanks in Advance
In your windows 2008, go to routing and remote access, go to IPV4, NAT, select the external network adapter, right click, properties.
Go to the third tab (ports and services) click add give a name to it
Set:
TCP
incoming port: 12345
private address: your pc local ip address
port 12345
Ok this is kind of embarassing but I just have a rather "noob" question.
In a client server TCP communications, where my system is a client accessing a remote server at say Port XX, isnt the client opening a random port YY in its system to talk to remote port XX?
So when we code we do specify the destination port XX right?
For the client, the port YY itself is chosen when the socket is created, isnt it?
Is there anyway I could monitor/restrict/control any client talking to a particular server?(like say clients talking to servers at specific serving ports??)
Is there any IPTABLE rule or some firewall rule restricting the client?
Can this be done at all??
Are destination ports saved in the socket structures? If so where??
Thanks!
First, server side creates a listening socket, with the chain of socket(2), bind(2), and listen(2) calls, then waits for incoming client connection requests with the accept(2) call. Once a client connects (socket(2) and then connect(2) on the client side) and the TCP/IP stacks of the client and the server machines complete the three way handshake, the accept(2) returns new socket descriptor - that's the server's end of the connected socket. Both bind(2) on the server side, and connect(2) on the client side take server's address and port.
Now, the full TCP connection is described by four numbers - server address, server port, client address, and client port. The first two must obviously be known to the client prior to the connection attempt (otherwise, where do we go?). The client address and port, while could be specified explicitly with the bind(2), are usually assigned dynamically - the address is the IP address of the outgoing network interface, as determined by the routing table, and the port selected out of range of ephemeral ports.
The netstat(8) command shows you established connections. Adding -a flag lets you see listening sockets, -n flag disables DNS and service resolution, so you just see numeric addresses and ports.
Linux iptables(8) allows you to restrict where clients are allowed to connect to. You can restrict based on source and destination ports, addresses, and more.
You can get socket local binding with getsockname(2) call, remote binding is given by getpeername(2).
Hope this makes it a bit more clear.
Yes you can create a firewall rule to prevent outbound TCP connections to port XX. For example, some organizations prevent outbound TCP port 25, to prevent spam being sent from network PCs to remote SMTP servers.