Jump to content




Ports in HTTP?


  • You cannot reply to this topic
5 replies to this topic

#1 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 26 November 2016 - 02:00 AM

I am hosting multiple web servers on one of my VPS' because I have apache2 for my PHP scripts, and nginx for a Krist development server. Apache on port 80 and the Krist/nginx server on port 8080.
I need to access the Krist server with port 8080, but doing it the usual way (protocol://address:port) returns nil for a response.
(If your wondering why I'm using 2 web servers, I can't pipe Krist through apache2, but nginx supports upstreams and socket files, so Krist is running on that)

This is the code in question:
local resp = http.get("http://192.168.1.104:8080")
The resp variable is nil, when it should send a HTML page since I'm using no APIs.

How would I accomplish getting data from port 8080?

Edited by Haddock, 26 November 2016 - 02:01 AM.


#2 EveryOS

  • Members
  • 570 posts
  • LocationOver there ->

Posted 26 November 2016 - 03:16 AM

Try routing it through a tcp webserver? With tcpsockets you can choose a port.
In ruby u can use these

Edited by EveryOS, 26 November 2016 - 03:18 AM.


#3 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 26 November 2016 - 03:39 AM

View PostEveryOS, on 26 November 2016 - 03:16 AM, said:

Try routing it through a tcp webserver? With tcpsockets you can choose a port.
In ruby u can use these
FYI, I'm using Debian 8 as the OS, if that matters to you
Krist is written in Node.JS, and it uses nginx so it is accessible from a domain. I can't disable Apache, because the VPS is also a half NAS running Nextcloud that doesn't save settings, so if I take Apache down I have to reconfigure Nextcloud. So technically I can change the ports, but I can't because the version of Nextcloud I'm using likes to save it's settings in the server's memory. I also can't listen on the same ports with two programs.

#4 TheRockettek

  • Members
  • 547 posts
  • LocationRem is best girl

Posted 26 November 2016 - 07:34 AM

You could try ttying to request a get by using my "proxy" site

you get "http://therockettek.hol.es/get.php?url=" and it returns the content of the site. It could be used as a hacky way of getting ports as the server will handle the getting of the web address :3 Im gonna make it better and alsp make it support post soon :D

#5 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 26 November 2016 - 11:25 AM

View PostTheRockettek, on 26 November 2016 - 07:34 AM, said:

You could try ttying to request a get by using my "proxy" site

you get "http://therockettek.hol.es/get.php?url=" and it returns the content of the site. It could be used as a hacky way of getting ports as the server will handle the getting of the web address :3 Im gonna make it better and alsp make it support post soon :D
It wouldn't work. My VPS is on my network, not exposed to the web. If it was a JS Script, it might of worked but (It needs to be clientside to work) it won't work with a local address.

Edited by Haddock, 26 November 2016 - 11:26 AM.


#6 TheRockettek

  • Members
  • 547 posts
  • LocationRem is best girl

Posted 26 November 2016 - 11:54 AM

View PostHaddock, on 26 November 2016 - 11:25 AM, said:

View PostTheRockettek, on 26 November 2016 - 07:34 AM, said:

You could try ttying to request a get by using my "proxy" site
you get "http://therockettek.hol.es/get.php?url=" and it returns the content of the site. It could be used as a hacky way of getting ports as the server will handle the getting of the web address :3 Im gonna make it better and alsp make it support post soon :D/>
It wouldn't work. My VPS is on my network, not exposed to the web. If it was a JS Script, it might of worked but (It needs to be clientside to work) it won't work with a local address.

erhm port forwarding...





2 user(s) are reading this topic

0 members, 2 guests, 0 anonymous users