Beating janky hosting restrictions
#1
I think the programmers among us may find this a bit funny.

I'm working on Volly Bounce for the first time since I moved JV over to the VPS from the old hosting provider. The way the environment was set up before I moved, users would send a login request from the VB client to a login.php file on the old server, which would send the login information to the socket server. (Sound familiar? That's because this process is ripped directly from PR2's code.)

The way the login.php script on PR2 connects to the socket server is it sends a request directly to the socket server via that server's address and port. Just one problem with that: the old hosting provider I was using prohibited any connections that weren't made via a list of approved ports. And, you guessed it, the port I was using happened not to be a port allowed to be used. Of course!

So, my options as I saw them were pretty much to either move JV (ended up doing this anyway) or upgrade the hosting plan (would've cost hundreds of dollars). I knew there had to be a way around this highway robbery. If I could move the process that made the actual connection to the socket server to the VPS itself, I could bypass my hosting provider's restrictions (as long as I made the connection to the VPS using an approved port).

One idea I had was to forward the port from 80 (HTTP) to whatever port on which the socket server would end up running. But... lol. That failed miserably, as could be predicted.

Eventually, I figured it out. I just made a passthrough PHP file that handled the input from the login.php script on JV and sent it as a regular web request to the VPS. Once the request got to the VPS, it was as easy as using the same talk_to_server function that PR2 uses.

Attached, please find the janky code I used to make this possible:
I'm glad not to have needed this, but I figured deleting it would just be a waste. So, here it is in all its janky glory!


I post about the latest site updates on the Dev Log. If you have suggestions, feel free to post them here.
@Eternal and I pay for this site out of our own savings. Please consider donating to help keep Jiggmin's Village running.
The Following 3 Users Say Thank You to bls1999 For This Useful Post:
  • Ashley766, gemj, Northadox
Reply
#2
waht
[Image: LLwQFov.png]
The Following 6 Users Say Thank You to Lego-man945 For This Useful Post:
  • bls1999, Camer the Dragon, Janelle, John m., new bat pr2, Northadox
Reply
#3
i understand none of that.
[Image: ZkcHvsf.png]
The Following 2 Users Say Thank You to new bat pr2 For This Useful Post:
  • bls1999, Northadox
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)