SkyHorse.Org

Server-side redirection (a.k.a. tunneling) with PHP

Some web applications, like my own cPanel and Web Mail, use non-standard tcp ports. Usually this is because they are part of a software package that runs alongside Apache but does not use it to serve the pages.

Problem is many corporate and university firewalls do not allow access to ports such as 2095 and makes all the neat web apps like the ones above completely useless until you get home (where you probably have some other e-mail software anyway).

For some time I have used a simple port redirector installed on my home computer which allowed me to see my e-mails from my work place and my university. This is a bit annoying, though, because not only I have to leave my pc on the all day just for this but also because it is a slower connection and I am the only one who can use it (yes, I am thinking about my own hosting clients/partners who complain about the same problem).

So, I am starting a journey to make a ‘transparent’ PHP application that can successfully accept an incoming HTTP connection, grab the headers and open a server-side connection to another service and use the incoming headers for the request. Upon reception of the response, the script must alter *all* tags to its own name and append a single GET variable with the original href.

Thus, on a simple page, where there is a:

<a xhref="www.skyhorse.org/abc.html?I=rule" mce_href="www.skyhorse.org/abc.html?I=rule">

there will be a:

<a xhref="redirector.php?requestedURL='www.skyhorse.org/abc.html?I=rule'" mce_href="redirector.php?requestedURL='www.skyhorse.org/abc.html?I=rule'">
.

I still don’t know if the use of ‘ or even ” will be tolerated by the HTTP request, but I think as a last resort I can always do some kind of two-way encoding (like base64 or something similar) to encode the original request in an AsciiSimple format.

For now, I have some proof of concept working (yikes, I can open a server-side socket in PHP!) but I am still a long way before I turn off my home computer during the day :)

If anyone has any information on how to accomplish what I am trying to do, please, do give me a shout :)

– Update 1

After some time I discovered another major issue: Images!
I think I will have to make a standalone script or function in PHP just to handle the redirection of images… yes, because there has to be a request for images to a PHP script and those images have to be quested server-side and returned… mmm … maybe not that complicated, just a redirect.php?requestImage=originalURL and the request.php will take care of returning just the binary information taken directly from the server-side connection made to the service… could work… will work!

–Update 2

Ok, so, I finally discovered I was re-inventing the wheel…
I had already looked for this on the web, but couldn’t find anything. But now I stumbled upon cpanelproxy .
It does exactly what is says on the label: server-side proxy to cPanel.
It’s funny how the script I was writting was starting to look like the script they made! Unfortunatelly it does not yet support SSL, perhaps I could find a way to implement it, but I think it would be almost impossible…

Tags: cPanel, Ideas, Programming, Web Design, WHM

Related posts:

  • DirectAdmin to cPanel : a partial BASH solution
  • The Definite Guide of Obscure Tweaks to Install and Maintain cPanel / WHM (version 10)
  • modsec.sh updated

This entry was posted on Monday, August 1st, 2005 at 8:50 pm and is filed under Ideas, Programming, Web Design. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

« Microsoft frowned at for smiley patent
My first (real) game of Poker »

Leave a Reply

  • Tags

    AI apple behavioural-targeting business Computing cPanel deep packet inspection design Downloads Games GNU/Linux google hacking hacking Hardware headphones hosting Ideas Instant Messaging iphone marketing mod-security online-advertising online media Personal Philosophy phorm poker Programming satire scripts Security sociology startups technology Travel ubuntu v-moda Visionarism web-2.0 web-marketing Web Design WHM wunderloop yahoo
  • Pages

    • About
    • Web Server Administration
      • Auto update modsecurity rules – modsec.sh
      • DirectAdmin to cPanel : a partial BASH solution
      • The Definite Guide of Obscure Tweaks to Install and Maintain cPanel / WHM (version 10)
        • Configuring E-mail (Exim) related areas
        • Fixing open DNS servers
        • Monitoring your server
        • Scripts and misc information
        • Security by Obscurity
        • Tweaking apache web server
  • Twitter Updates

    • Ads

    • RSS NMA

      • Facebook sees more US weekly traffic than Google for first time 17 March, 2010
      • Absolute Radio collates presenters' social updates 17 March, 2010
      • Walkers chooses social sites over its own for consumer engagement 17 March, 2010
    • RSS Brand Republic

      • OFT clears Independent sale to Lebedev 17 March, 2010
      • Maurice Levy and Publicis Groupe board to forgo bonus 17 March, 2010
      • Westminster Media Forum: CSR and schools marketing come under fire 17 March, 2010
    • RSS iMedia Connection: Consumer Strategies

      • 5 marketing battles that make no sense
      • The 4 Cs of scaling social media
      • The underlying drivers of social media success
    • RSS Behavioural Targeting news

      • Former Yahoo Data Executives Join Forces to Create nPario, a Startup that ... - IT News Online 17 March, 2010
      • Coke Uses Digital Billboards To Engage Passersby - MediaPost Publications 17 March, 2010
      • What Is Behavioral Targeting - And What It Is Not - ClickZ News 17 March, 2010
      • Towards a Bill of Rights for Online Advertisers - Huffington Post (blog) 16 March, 2010
      • Who Owns The Privacy? - Mediapost.com 12 March, 2010
    • RSS Adotas

      • Yahoo! Wants to Get More Personal 17 March, 2010
      • Rebranded Image Space Media Revamps Pub Interface 16 March, 2010
      • Developers Digging Windows Phone; Microsoft Employees Still Love iPhones 16 March, 2010
    • RSS MarketingVox

      • @anywhere Complicates Metrics for Twitter Marketing Success 17 March, 2010
      • PointRoll Builds on Trend of Marrying Ads, Editorial 17 March, 2010
      • New Ad Opps Abound at Airports, in the Air 17 March, 2010
    • RSS ExchangeWire.com

      • EBuddy Announces Seven-Figure Deal With InMobi; Rubicon Moves In To The French Market 17 March, 2010
      • Janneke Niessen: The Current Yield Optimisers Will Evolve Into True SSPs 16 March, 2010
      • How Online Advertising Really Works In Europe; Real-Time Bidding Best Practices Whitepaper 12 March, 2010
    • RSS SimsCity blog

      • Attaching pixels to pages 2 January, 2009
      • Frequency capping 28 December, 2008
      • ITV player 27 December, 2008
    • RSS Donald Hamilton

      • Never a True Word said with an “F” 1 December, 2009
      • Whose audience is it anyway? 19 October, 2009
      • Online ad spending bucks trends 29 September, 2008
    • RSS Segmentacion por comportamiento

      • La “Santa Alianza” contra Google. 18 February, 2010
      • Torsten Ahlers, CEO de wunderloop, en el OMExpo2010 26 January, 2010
      • Lanzamiento de la Alianza de editores en Alemania, con la tecnología de wunderloop como motor. 26 January, 2010
    • RSS Sandlines

      • the iPad and Marketing 28 January, 2010
      • The anticipation of disappointment 7 December, 2009
      • Groundhog Day 27 November, 2009
    • RSS ladig.net

      • DMEXCO Premiere war erfolgreich / Topthema Targeting 6 October, 2009
      • Mit „Behavioral“ den optimalen Werbe-Weg finden 8 May, 2009
      • Mit ToDo und Toodledo das Chaos beherschen 6 May, 2009
    • Ads

    • Blogroll

      • 90kts
      • Acxiom Poker Nights
      • Amy’s blog
      • Bytter’s blog
      • morena flor no samba da saudade
      • Not Quite There Yet
      • Swedish Pirate Party
    • Cartoons

      • Geek & Poke
      • Order of the Stick
      • User Friendly
    • Gaming

      • Neverwinter Nights
    • online media

      • Knowledge for the Digital Economy
      • Mike on Ads
    • Personal

      • Atelier de Camisa
      • Banksy
      • Designarte
      • My Amazon Wishlist
      • SkyServers.Org
    • Science

      • New Scientist
      • Rex Research
      • ScienceBox
      • Wired
    • Security

      • GPG4Win
      • GPGol
      • GPGShell
      • Mod Security
      • Offline Windows NT(2k,XP) Password Recovery
    • Web Design

      • PageStrength
      • SiteScore
      • UrlTrends
    • Akismet

      51,382 spam comments
      blocked by
      Akismet
    • Meta

      • Log in
      • Entries RSS
      • Comments RSS
      • WordPress.org

    © 2003 - 2010 Paulo Cunha | SkyHorse.Org is proudly powered by WordPress | Theme based on Bob