4 comments

  1. said…

    The suggested plugin makes an additional request using file_get_contents!
    Not cool.

    There’s a better idea. Put this in your wp-config.php

    ob_start( ‘s_localhost_192’ );
    function s_localhost_192( $string ) {
    return str_replace( ‘http://localhost/’, ‘http://968f7806.ngrok.io/’, $string );
    }

    credit: https://core.trac.wordpress.org/ticket/17048

    I had a more complicated code I have used in the past but can’t find it now.

    • said…

      Slavi,

      The reason I wouldn’t do it that was is that the hostname you get for ngrok changes every time you launch it (unless you pay for a custom hostname with them). You’d constantly be changing that code to match. The extra file_get_contents() request isn’t great, but then again, you’re not using this in production, so it isn’t a huge deal.

  2. Have you looked at all at the new ngrok features in Vagrant 1.9.2?

    • said…

      Hey Chris – I haven’t looked into Vagrant 1.9.2 yet. I find at the moment I’m only loading Vagrant if I’m working on core with VVV. Most of my projects are in Docker containers right now. I’ll have to check it out though. Thanks!

Leave a Reply