Communication between two computers using an Internet Browser and Sockets? [closed] - sockets

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
How may I create a socket on my computer that could be reachable from other computers via internet, and work like a web server, maybe using WebSockets?
By the way: could my web server become visible from the Internet and how?
I know I can install a LAMP web server on my computer (my OS is Ubuntu) and use it for a local network.
I know I can use sockets to let 2 computers communicate via internet using their IP addresses (I did it in Java).

You can make your LAMP server stack accessible from the internet by forwarding ports from your external internet connection to the computer the server stack is running on. If you're doing this at home, you can usually handle port forwarding from the admin interface for your router/modem.
Alternatively, WebRTC is a newer web technology (still in the testing phase) that allows two browsers to connect to each other without the need for an intermediate web server.

Browser does not permit raw sockets.
You can not create a socket from browser, because it would be security hole.
For example you download a page from internet and script on this page opened all sockets on your computer.
Websockets it is technology on top of TCP protocol.
Using Websockets you can connect two browsers to a Websocket server and exchange information via this server.

Related

How can I view a localhost apache website from another computer on the same network? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I have a Raspberry Pi on my network on which I would like to host a website. I don't want to plug it to a monitor but still be able to work on the website.
So I access it via SSH from my main computer to edit the files etc... but I didn't find a way to view the website from my main computer.
I didn't wrote over the 000-default website but created a new one so I see the default Apache page when I type in http://localhost.
I also tried using ssh -X but my main computer is a Mac and I have issues with making X11 work.
So my question is how can I preview from my Mac an Apache website that is not the default one, when the website is hosted on a Raspberry Pi on my network?
Two methods
Setup a VNC connection
Connect using ssh to RPi and prepare it for VNC using sudo raspi-config
at Interfacing options enable VNC and at Advanced options set the resolution. Then use a VNC client on your MAC to connect to RPi
Useful link: https://www.raspberrypi.org/documentation/remote-access/vnc/
Using Local Forwarding
ssh -L 8080:intra.example.com:80 gw.example.com
This example opens a connection to the gw.example.com and forwards any connection to port 80 on the local machine to port 8080 on intra.example.com.
Useful link: https://www.ssh.com/ssh/tunneling/example

Minecraft server hosted on PC without internet, just a router/modem [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I'm wondering if its possible to host a Minecraft server on my PC and have my wife connect to that server without any internet connection. We are willing to get a router/modem or switch if need be. We just can't use internet and need instructions on what to get, how to set it up, and how to use it. My hope is that it is possible to have our computers in the same room, plug our PCs into a router that has no internet service via Ethernet cables, turn on the server on my PC, my wife can type in the IP and we can play together.
Yes you can. I am running a Minecraft server on a separate Linux machine, and me and my brother connect to the Minecraft server from separate computers, all of it from our own wireless LAN and without an Internet connection.
We are using a WiFi router that is not connected to the Internet, the computer running the server is an old laptop, and then we have two additional computers, each running an instance of Minecraft, and it all works fine.
I'm not sure about using only a network switch, because you need to be connected at the IP layer, since you need to specify the internal, private IP address of the computer running the Minecraft server from the Minecraft client in order to join.
So in a nutshell, you will need to download and install the Minecraft server, install the latest Java OpenJDK, run the Minecraft server, read the eula, and last in order for this to work completely offline (that is, we want this to work without an Internet connection), you will need to go into the Minecraft server configuration file, locate the property of online-mode=true and set it to online-mode=false.
This setting basically controls whether or not players authenticate to Mojang's servers before they connect to your server, and it prevents players with cracked clients from connecting to your server, but since you will be hosting and joining from within an internal, private network anyways it does not matter. No one will be connecting to your server from the outside world if there is not a connection to the Internet anyway.
For more details about how to install and run a Minecraft server, there are many guides out there. It's actually pretty simple, if you're comfortable using a console screen and know just a little bit about IP addresses and editing a configuration file with a text editor. For me, I run the Mi ecraft server and I was able to connect to it with my brother and start playing right away, without having to mess around with the server at all.
So there you have it, I hope this helps someone.
The very definition of a server is something that provides resources over the internet:
A server is a computer program or a device that provides functionality for other programs or devices, called "clients", over the Internet.
There is a way that would work the way you intend, but without Ethernet, it runs over WiFi. Go into a world, open the Pause menu, and click Open to LAN. Then you can go to a server menu on another computer and it will show up in the LAN Worlds section. However, this will only run vanilla gameplay.
Just FYI, this question would be considered off-topic here and should be asked in the Gaming or Networking communities.
EDIT: Opening to LAN would work over ethernet too.

Redirect port 80 to my home server [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I installed Ubuntu server 16.04 on one of my computer to setup a web server. I want to install Phabricator to manage a video game project with some friends. I'm trying to configure my router (Home Hub 1000 from Bell) to redirect port 80 to this server. The problem is that it doesn't work at all. I can access to my web page from a computer on my local network with the name of the computer, but not from the outside using my IP address (the one used by my router). I added my server to DMZ and I had set up a port forwarding (Protocol: Both, Internal port: 80, External port: 80). My server use a reserved IP address configured on my router.
Thanks for your help.
Besides of a reserved local ip-address, it is useful to have a static ip-address from your provider(because they might change your ip once and a while). You can find your ip on whatismyip.com
When both port forwarding and DMZ are configured in your router, you can look if there is firewall on your server which blocks the external requests.

which server can host iOS push notification [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I cannot host my own server for iOS push notification because the router is limited by Admin.
I want to learn from scratch so I don't want to use Parse or quickblox. Where and how can I know which PHP hosting plan support iOS push notification? Is there any free hosting available?
From Apple, the server need to allow inbound and outbound TCP packets over port 2196. I don't think regular hosting plan will list out this information.
http://developer.apple.com/library/ios/#technotes/tn2265/_index.html#//apple_ref/doc/uid/DTS40010376-CH1-TNTAG41
When I learnt Android push notification, I can easily find a hosting plan with CURL. iOS is a bit demanding.
The port that you really need for sending push notifications is 2195. Even though the TCP packets are both inbound and outbound from your server, the connection is only outbound (you initiate the connection to Apple). Most web host providers won't have an issue with this.
Port 2196 is the feedback service, which you should implement, but it's optional. It's the same way, inbound and outbound TCP packets over port 2196, but you initiate the connection.
When a device registers with your server for push notifications by sending the device token, the device initiates the connection, and you have your choice of how to send the notification to the server. If you send it via HTTP (with NSURLConnection, for instance), any basic web server will do.
I implemented Easy APNS in only a couple hours and it works fine on my shared hosting environment at Dreamhost. You just need a basic LAMP stack (Linux, Apache, MySQL, PHP) and a downloaded copy of your APNS certificates. Easy APNS is all open source, so you can see how they're doing it.

XMPP ejabberd server is not able to connect gtalk server [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I have configured ejabberd server on localhost. I am able to connect to local host like admin#localhost, but i am not able to connect gtalk server. Some one please help me how to connect to gtalk server.
Thanks in advance,
sathi
In order for you to talk to GoogleTalk, they have to be able to talk back to you using Dialback. There are several steps you'll need to do:
Rename your server to a fully-qualified domain name. (e.g. example.com)
Open a hole in your firewall in both directions to your server on port 5269/tcp.
Add an SRV record to your DNS pointing at that firewall hole. If your domain was example.com, your SRV might have _xmpp-server._tcp.example.com pointing to 10 0 5269 myserver.example.com.
At some point in the future, you may also need an X.509 certificate for doing TLS.
I almost lost hope, but this thread was really helpful:
Short summary - disable google apps for domain, it can be the reason of getting 404 errors in ejabberd log.