Localhost for corona

is it possible to connect to a remote database, using an ip address?

Such as

network.request(“192.176.1.123”,“GET”,FunctionToFollow)

I get an error when i use an ip address… I am very new to this type of concept… does the url only accept published databases on the internet?

There has to be a way to practise this locally!

Thanks for any help in advance!

The network.request() API call expects to connect to a web server running the HTTP protocol.  Since HTTP requires a URL, trying to connect to an IP address doesn’t make a lot of sense.  You could do:  “http://192.176.1.123/” and retrieve the home page index.html file from that host.

It sounds like to me you are wanting to do socket level things and you can do that.   We support Lua sockets.

Rob

omg thankyou very much! You have truly blessed me jedi!

Possibly worth mentioning:  the HTTP protocol is pretty simple.  If you have control of the “other side” of the connection, turning a socket-based server into an http-like server may not be too difficult.  And of course, you could just use any of the great open-source http servers instead of writing your own; apache, nginx, lighttpd – as a bonus, you can then do some of your server-debugging with a browser.

The network.request() API call expects to connect to a web server running the HTTP protocol.  Since HTTP requires a URL, trying to connect to an IP address doesn’t make a lot of sense.  You could do:  “http://192.176.1.123/” and retrieve the home page index.html file from that host.

It sounds like to me you are wanting to do socket level things and you can do that.   We support Lua sockets.

Rob

omg thankyou very much! You have truly blessed me jedi!

Possibly worth mentioning:  the HTTP protocol is pretty simple.  If you have control of the “other side” of the connection, turning a socket-based server into an http-like server may not be too difficult.  And of course, you could just use any of the great open-source http servers instead of writing your own; apache, nginx, lighttpd – as a bonus, you can then do some of your server-debugging with a browser.