Is it safe to port 80 for the Mobile or embedded device - mobile

Let's say I have iPhone, or Android or Embedded system and I want to use Socket programming to establish a connection between them, Mobile to embedded system.
Is it OK to use port 80 of mobile and embedded system to establish the connection?
Can I hardcode port 80 into the code for both Mobile and embedded system?

Generally, ports below 1024 are considered "privileged" on Unix-style systems, from which both Android and iOS inherit much of their basic under-the-covers functional design.
You will not be able to use port 80 on a secured (typical consumer, unhacked) Android device.
While I haven't tried it, I expect you will not be able to on an iphone either - iOS applications which I have seen which create a web server to expose selected data typically use higher port numbers in the unprivileged range.
You have two general options for picking the port number: guess a safe default (possibly already in customary use for the type of function you want - 8080 is a common choice for an unprivileged http server) and allow the user to change it if needed in some configuration menu, or pick a random free port and inform the user what it is so that they can enter that on the other end.
Also note that you will typically only be able to direct traffic to a phone when it is on a wifi network. Putting the two requirements together, access to your embedded server would probably be via a URL something like
http://192.168.0.111:8080/somepage.html
Where of course the ip address, port number, and remainder of the URL are correct for you actual run time situation.

Related

How to let a raspberry pi 3b connect to wifi with wps from within a c program

I have a machine controlled by a raspberry pi. For servicing I want to connect the local wifi network. The machine has no controls with which you could enter ssid and password. With a combination of button pushes a connection to the wifi must be made.
In my program I have the following code:
void start_Wps(void) {
if (!fork())
execl("wpa_cli","-i","wlan0","wps_pbc", NULL);
}
If I start my program from a ssh terminal it works most of the time. However when I let my code start from rc.local the rpi never connects to my wifi network.
In case your project shall work in an enterprise environment, can you be sure that WPS is supported on the client’s access points?
Another thing to consider: WPS is in decline. It is not supported e.g. in Android since Android 9, WPA3 security won’t be supported by WPS and its successor has already been presented by Wi-Fi Alliance.
It is called “Wi-Fi Easy Connect” and it basically is a device provisioning protocol that also allows the connection of “headless” device, i.e. without display or input. You could connect your mobile phone to the Wi-Fi network on the customer’s premise, read the QR code that you previously put on your machine and then the phone takes care of connecting the machine to the network.
More detailed information is provided on Wi-Fi Alliance’s website: https://www.wi-fi.org/discover-wi-fi/wi-fi-easy-connect
If you want to make sure that your project is future-proof and will be maintainable for years to come, you might want to look into that.

Application that connects to node REST api is being blocked by customers firewall

My company and I is developing an angular application that gets its data from our own build API.
The API is build in node.js using express and runs on port 8080.
We sell licences to medium sized / huge companies.
A common problem we have with our clients is that once they try to log in to the system they get rejected (by their own firewall) because it does not allow traffic on port 8080. Which means that each of our clients will have to run by their own IT department to get our system to work.
This is of-course always a bad start with new clients.
So my question is: is there a way to avoid this either by choosing a "safer" more common port or am i doomed to have this embarrassing remark on my system?
I'd say you can simply use port 80. It is the most commonly used port for HTTP. Or 443, the most commonly used port for HTTPS. They are probably the most likely ports not to be blocked by firewalls.

What other non-default ports can i use for webserver?

I am using 80(http) and 443(https) default ports for my webserver.
What ther ports other than this can i use for my webserver.
I need this basically to start my webserver using non-default ports.
Any. Look at these for the ones to not use:
http://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers
You can use whatever ports you want to use, provided no other server on your box is also trying to use it.
This is, of course, subject to any OS-specific issues like needing to run with elevated privileges for binding to ports below 1024.
The IANA (naming authority) and ICANN (assigned names and numbers) is responsible for assigning ports to specific applications but there's nothing requiring you to follow those "rules" at all.
If you use (for example) port 23 for your HTTP server, that will work. It's likely to confuse any telnet programs attempting to connect to that box but, as stated, the box is under your jurisdiction, not that of the IANA. Provided your browsers hook up to the specific port 23, they'll work just fine.
By way of example, many IBM mainframe systems will use port 23 for their 3270-protocol terminal programs and bump "real" telnet up to port 1023.
And, in any case, why should you not use a port because it's "allocated" to the Quake game server, or Dropbox, or Symantec bloatware? :-)

Silverlight 4 in the real world - communication with server

We currently have a silverlight application (kind of a game) and we need to add more functionality which requires more interaction with the server.
We currently do all interaction by HTTP requesting data from the server and then processing on the client - works well, until we have a lot of requests or larger data amounts being returned.
Sockets in Silverlight only work on port numbers between 4502 and 4534, is there a way of making this work on the internet? A way of allowing the user to simply accept and open up a port?
What is actually blocking the port range?
========
Just to add, is this somthing that is possible in Java (http://homepages.uel.ac.uk/2795l/pages/socketap.htm)
The only way to achieve this is via a proxy on the server or some sort of port forwarding taking place on the server.
This can not take place on the client side by itself.
What is actually blocking the port range is the SL runtime. It does this for security reasons.
In reality making use of sockets in an Internet based application would provide some hurdles most notably the need for the firewall to allow ports 4502-4534 to be open for Silverlight communication. This is one reason that the use of sockets is used more within an Intranet application where the need to open ports is non-existent (for the most part). Since Silverlight has defined these ports as the means of communication for their runtime it at least gives the admins some control over that range; versus allowing the runtime to operate on any given number of ports.
No direct way around it ( http://blogs.msdn.com/b/ncl/archive/2009/06/23/why-does-silverlight-have-a-restricted-port-range-for-sockets.aspx ).

wireless networks c program

I would like to create a wireless network from a laptop. If laptops come within range, I would like it to send them a welcome message and send them a goodbye message when they leave the wifi range. Is it possible to do this in C?
Please help me out with this.
It is possible, but it is a very complex task and I don't think that programming language choice is the first thing to look into.
As a start, you can read up on Wikipedia on Wireless ad-hoc networks.
How should your messages be received and displayed on the remote side? If you want to use some existing protocol over TCP/IP, or create your own (deploying custom applications on the remote machines), you will need to mess with networks and this is not always possible as one machine can be a part of only one network. So the machines need to be not connected to anything and somehow allow you to connect to them, it involves changing network settings on all that machines (for example, setting them to join the ad-hoc network with predefined name).
If all machines automatically join the existing network, this question has nothing to do with wireless (physical layer) but with Avahi, Netbios or whatever other services allowing you to get notifications and/or enumerate devices in the network.

Resources