localhost (meaning this computer) is the standard hostname given to the address of the loopback network interface. The name is also a reserved top-level domain name[1] (cf. .localhost), set aside to avoid confusion with the narrower definition as a hostname.(copied from WIKI)
follow the
link[
^] to get some example.
Finally follow the
link[
^] to get the idea of how to connect from remote machine. you can also read this
link[
^]. please do little searching on google