Can I set up a server that works from my computer?

0

I have a Delphi chat that works only on the internal network, I also have the project for it if you want to make a change, and I wanted to know if it is possible to make this chat work on remote network computers from a mounted server on my own PC, as an example, Apache or any other type.

    
asked by anonymous 05.08.2015 / 02:13

3 answers

2

It is possible, but not recommended for obvious reasons: 24 hour operation, security, stability, guarantee and quality of connection, performance, energy, etc.

Nowadays it is so cheap a hosting or a VPS that there is no reason to host in its own structure - its final cost probably (and side effects) will be much higher hosting on your computer. You do not even have to register a domain, you can use VPS IP directly.

Some affordable services:

05.08.2015 / 02:49
2

If you meet this:

  • Your client application connects to the server, not the opposite;
  • Your computer has a real IP or you can configure your router, or more than one if you have (unusual but exist), to forward the requests to the ports assigned to your application or your application can configure the router with uPnP works with a single router);
  • Your external IP is fixed or you have a dynamic DNS service or each time a client connects it will know your IP.
  • Certainly it is possible.

    If they are common http requests, the 80 port must be exposed to an external real ip. If they are https , the common port is 443 . It can be any port you want, it does not even have to be the same external and internal port.

    These numbers are default settings, as the application is yours, you can choose any number, just configure your network accordingly.

    Editing

    I agree with AlfredBaudisch's recommendation. +1 for his response.

        
    05.08.2015 / 02:52
    2

    The short answer is:

    Yes. It is perfectly possible to make this happen. You do not need any specific application like Apache. All you need is a router, know your Public IP and redirect, on your router, the packets coming from Public IP to a specific TCP port for the internal IP of the computer that is running the Chat server. This port forwarding is critical, unless the chat is running on the router itself.

    The long answer is:

    On the internal network, if the computers are on the same subnet, it is easy to get them to communicate. This is your current case.

    However, when you want to communicate with a computer that is inside your home, from a computer that is outside your home, things get a little more complicated. The bottom line is that in order to communicate in this way, you need to know your Public IP, that is, the IP that the provider provides you so that you can browse the Internet from your home.

    It is very common for the provider to also provide you with a router as this allows multiple devices that are connected to your home network, whether over Wi-Fi or wire, to browse the Internet simultaneously. In addition to knowing your Public IP, you need to know in which TCP port your chat is listening (you already know).

    To better understand, let's call the computer outside your EXT home and the computer inside your INT home. The INT is connected to your home router, here called ROT .

    EXT - External Computer - Hypothetical Public IP: 200.123.12.21

    ROT - Router (or gateway) that connects INT to the Internet. IP Hypothetical public: 179.79.12.12. Internal IP: 192.168.1.1

    INT - Internal Computer - Hypothetical Internal IP: 192.168.1.23. TCP port hypothetical that the chat server is listening on: 3131

    It basically works like this:

    Goal: EXT You want to connect to a chat service by running on the INT machine that is in the @PascalStarting home;

    • EXT needs to know the public IP of ROT .
    • EXT You also need to know the port that the chat service is listening on.
    • EXT then, with the chat client, connects to 179.79.12.12.12:3131.
    • The packet sent by EXT goes through multiple routers until you reach ROT .
    • At the time this packet arrives in ROT it is redirected to port 3131 on Internal IP 192.168.1.23 (the INT IP)
    • INT then receives this packet, processes and responds. (As INT responds and this package comes back in EXT I leave it for you to search.)

    Basically that's it. There are interesting issues to consider, such as security and availability as the other response said. Another very important issue is that providers constantly change their Public IP, therefore having a Dynamic DNS or Dynamic DNS (DDNS) service configured on the router is fundamental.

    As a way of learning, I strongly recommend that you try this, as much will be learned in the process.

    As a matter of curiosity, I have a scheme like this in my house. I can connect a computer remotely, work and then turn it off, also remotely. However, since I'm boring with security, I use SSH Port Forward. My router is a TP-Link N750, running OpenWRT (Linux), so I can have SSH and other services that allow me to safely manage my home network.

        
    05.08.2015 / 03:07