Recent

Author Topic: synapse bind method  (Read 4540 times)

epergola

  • Full Member
  • ***
  • Posts: 157
synapse bind method
« on: August 25, 2016, 10:18:51 pm »
HI all
Can anyone help me with this?
I want to have asynapse httpserver runnig on a remote site (basically a PC).
What is the correct way to set the parameters for bind()?
The server is running in memory on the remote PC and uses a Dynamic DNS service.
Assuming it has port 80 open.
Should I use bind('0.0.0.0,80) or
  bind('127.0.0.1',80).?
Or perhaps the use the ip corresponding to the dns name?
Thanks

epergola

  • Full Member
  • ***
  • Posts: 157
Re: synapse bind method
« Reply #1 on: August 25, 2016, 11:22:02 pm »
Or perhaps the use the ip corresponding to the dns name?
that would not make sense. I must have been half-aslee.

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: synapse bind method
« Reply #2 on: August 26, 2016, 03:40:43 am »
Bind on 0.0.0.0 .

I mean even if you do that you can (and should) still connect to it locally with 127.0.0.1.
« Last Edit: August 26, 2016, 03:44:32 am by User137 »

epergola

  • Full Member
  • ***
  • Posts: 157
Re: synapse bind method
« Reply #3 on: August 26, 2016, 04:42:54 am »
Sorry, what does
I mean even if you do that  mean? i do what?
From what you say it seems tha i should use
 bind('127.0.0.1',80) and not  bind('0.0.0.0',80)?

User137

  • Hero Member
  • *****
  • Posts: 1791
    • Nxpascal home
Re: synapse bind method
« Reply #4 on: August 26, 2016, 01:46:20 pm »
bind('0.0.0.0',80)

and

http://127.0.0.1  to connect to it.

rvk

  • Hero Member
  • *****
  • Posts: 6163
Re: synapse bind method
« Reply #5 on: August 26, 2016, 01:56:52 pm »
The server is running in memory on the remote PC and uses a Dynamic DNS service.
Yes... bind('0.0.0.0',80).
It will bind to ALL available network interfaces.

You can connect from that same machine to http://127.0.0.1 or http://localhost

But when you want to connect from another PC (you said this was a remote PC) you need to know the IP address (or host-name) of the PC you're running this httpserver on. This is the internal IP address on your local network.

Then connect http://x.x.x.x (where x.x.x.x is the IP) or http://hostname (where hostname is the hostname of that PC) from any PC on your local network.

If you want to connect from OUTSIDE your own local network you need to do some port-forwarding.
(let us know if that's the case)

« Last Edit: August 26, 2016, 01:58:27 pm by rvk »

epergola

  • Full Member
  • ***
  • Posts: 157
Re: synapse bind method
« Reply #6 on: August 26, 2016, 06:31:49 pm »
Tx user137.
Hola RVK, long time!.
Yes that is the case, but I think I got that covered. i.e. yes connect from outside
and yes port 80 should be 'open' or forwarded on the PC that runs the http server.


 

TinyPortal © 2005-2018