<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Jamie Norman on Medium]]></title>
        <description><![CDATA[Stories by Jamie Norman on Medium]]></description>
        <link>https://medium.com/@jamie.norman?source=rss-86f40b9de12f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*dOJ6oi-TAi4hbeUeiRTzdg.jpeg</url>
            <title>Stories by Jamie Norman on Medium</title>
            <link>https://medium.com/@jamie.norman?source=rss-86f40b9de12f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 10:00:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@jamie.norman/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Laravel Mix, Browersync and ngrok playing happily…..]]></title>
            <link>https://medium.com/@jamie.norman/laravel-mix-browersync-and-ngrok-playing-happily-b8a9db333c3b?source=rss-86f40b9de12f------2</link>
            <guid isPermaLink="false">https://medium.com/p/b8a9db333c3b</guid>
            <category><![CDATA[laravel-mix]]></category>
            <category><![CDATA[device-testing]]></category>
            <category><![CDATA[ngrok]]></category>
            <category><![CDATA[browsersync]]></category>
            <category><![CDATA[laravel]]></category>
            <dc:creator><![CDATA[Jamie Norman]]></dc:creator>
            <pubDate>Wed, 23 Jan 2019 13:36:24 GMT</pubDate>
            <atom:updated>2019-01-23T16:11:04.904Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6MatcZJwZE1ygQzYTncjjw.png" /></figure><p>We work on a shared network that blocks all ports apart from 80,443.</p><p>So we can’t connect our mobile devices to the local browsersync URL.</p><p>Therefore we needed a way to route traffic via a proxy, for testing our application on various devices whilst developing</p><p>Step forward ngrok (<a href="https://ngrok.com/">https://ngrok.com/</a>)</p><p>In order to set up browser sync and ngrok you have to establish the tunnel first, as you need to tell browsersync how to route the websocket traffic</p><p>It is important to choose a port that is free on your machine<br>you can do this by running</p><pre>netstat -na | grep “&lt;potential Port Number&gt;”</pre><p>If nothing is using the port then you won’t get anything returned.</p><p>Next up you need to set up the Tunnel FIRST.</p><p>If you have Laravel Valet install you can use ngrok that comes with it, or you can install from their site. [ngrok downloads](<a href="https://ngrok.com/download">https://ngrok.com/download</a>)</p><pre>./ngrok http &lt;potential Port Number&gt;</pre><p>or if you have Laravel Valet installed</p><pre>~/.composer/vendor/laravel/valet/bin/ngrok http &lt;potential Port Number&gt;</pre><p>Once you have run up the tunnel it will give you a forwarding URL</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hAA282AMchpCxFhPCVE_QQ.png" /><figcaption>ngrok running</figcaption></figure><p>This is the URL we got in this example</p><p><a href="http://28024542.ngrok.io/">http://28024542.ngrok.io</a></p><p>Head over to your web pack configuration in webpack.mix.js</p><p>If you don’t do this browsersync won’t be able to route the socket connection correctly, as it will be trying to route it to the port it has started up on I.E 3000.</p><p>Your external ngrok tunnel will only be routing traffic back on port 80, the socket option below allows you to override that.</p><p>and replace the domain with the url you have from ngrok</p><pre>mix.browserSync({<br> files: [<br> ‘app/**/*.php’, //app php file<br> ‘resources/views/**/*.php’, // Views<br> ‘resources/views/**/*.blade.php’, // Views<br> ‘public/js/**/*.js’, //Javascript<br> ‘public/css/**/*.css’, //default css<br> ],<br> proxy: “&lt;YourLocalTestDomain&gt;”,<br> port: 21542,<br> socket: {<br> domain: ‘http://<a href="http://28024542.ngrok.io/">28024542.ngrok.io</a>:80’<br> }}<br>);</pre><p>and that is it, run up the app</p><pre>npm run watch</pre><p>and you should be able to visit the ngrok url on your devices and see browsersync connect.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b8a9db333c3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>