<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dusty Shaw</title>
    <description>The latest articles on DEV Community by Dusty Shaw (@dustyshaw).</description>
    <link>https://dev.to/dustyshaw</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1171777%2F42ae7cc3-ca0e-45c7-804d-e15514398c4b.jpeg</url>
      <title>DEV Community: Dusty Shaw</title>
      <link>https://dev.to/dustyshaw</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dustyshaw"/>
    <language>en</language>
    <item>
      <title>Dev Tunnels for Mobile Development</title>
      <dc:creator>Dusty Shaw</dc:creator>
      <pubDate>Fri, 16 Feb 2024 18:30:25 +0000</pubDate>
      <link>https://dev.to/dustyshaw/dev-tunnels-for-mobile-development-39pl</link>
      <guid>https://dev.to/dustyshaw/dev-tunnels-for-mobile-development-39pl</guid>
      <description>&lt;p&gt;&lt;a href="https://i.giphy.com/media/Vz622byHI3Ef9X1l3c/giphy.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://i.giphy.com/media/Vz622byHI3Ef9X1l3c/giphy.gif"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Have you ever wanted to share your project with someone without having to publish? Or maybe when you run an emulator using your API, you get a 404 error on your API endpoints. &lt;a href="https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-8.0" rel="noopener noreferrer"&gt;Dev tunnels for Visual Studio 2022&lt;/a&gt; create a unique URL that you can use in your mobile projects to debug API's. Visual Studio 2022 now let's you create dev tunnels with a click of button.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Scenario
&lt;/h2&gt;

&lt;p&gt;Say you have an API running in your mobile app. This mobile app calls an API at a local URL (ex. &lt;code&gt;https://localhost:7223&lt;/code&gt;). However, when you want to run an emulator, the emulator has its own network, so it can't find the local host.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw9xomd6a9z9nfwp1x5c.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Faw9xomd6a9z9nfwp1x5c.png" alt="Diagram showing an emulator attempting to call localhost"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Make a Dev Tunnel using Visual Studio 2022
&lt;/h2&gt;

&lt;p&gt;To create a Dev Tunnel, go to the run button and hover over the drop down menu. Go to &lt;strong&gt;Dev Tunnels&lt;/strong&gt; &amp;gt; &lt;strong&gt;Create a Tunnel...&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvig5m3kh8lc3j4auxp2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkvig5m3kh8lc3j4auxp2.png" alt="Visual Studio 2022 Dev Tunnel Menu"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A window will pop up for some settings on your tunnel.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure your GitHub (you will likely have to log in)&lt;/li&gt;
&lt;li&gt;Give it a name&lt;/li&gt;
&lt;li&gt;Tunnel Type

&lt;ul&gt;
&lt;li&gt;Temporary: will give a unique URL each time you open Visual Studio&lt;/li&gt;
&lt;li&gt;Persistent: URL will persist between runs&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Privacy:

&lt;ul&gt;
&lt;li&gt;private: only accessible to you (safest)&lt;/li&gt;
&lt;li&gt;organization: only accessible to the same organization associated with the account.&lt;/li&gt;
&lt;li&gt;public: anyone with a URL can access your tunnel (not as safe)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;Hit "Ok" to create your dev tunnel.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcv8jwdttxwhsdgeoygz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjcv8jwdttxwhsdgeoygz.png" alt="Visual Studio Create a Dev Tunnel Screen"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Run Using your Dev Tunnel
&lt;/h2&gt;

&lt;p&gt;In the same drop down menu, select the dev tunnel you just created.&lt;br&gt;
&lt;strong&gt;Dev Tunnels&lt;/strong&gt; &amp;gt; &lt;strong&gt;My First Tunnel&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  3. See Output
&lt;/h2&gt;

&lt;p&gt;Run your app and click continue on the blue screen that shows up. This is there to warn you that you are entering a dev tunnel that could be public.&lt;/p&gt;

&lt;p&gt;Look at the URL. That's not localhost! It creates a unique URL so that people can now talk to your project and API through the internet, including those pesky API endpoints.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Old URL: &lt;code&gt;https://localhost:7223/swagger/index.html&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;New URL: &lt;code&gt;https://50tt58xr-7223.usw2.devtunnels.ms/swagger/indexf.html&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  4. Manage your Dev Tunnels
&lt;/h2&gt;

&lt;p&gt;You can manage your Dev Tunnels in the "Dev Tunnel Dashboard" page in Visual Studio. &lt;/p&gt;

&lt;h3&gt;
  
  
  Summary
&lt;/h3&gt;

&lt;p&gt;You have created your first Dev Tunnel using Visual Studio. Now you can create unique URLs that you can use for debugging API endpoints, webhooks, or simply for sharing your project across devices. &lt;/p&gt;

&lt;p&gt;Have Fun!&lt;br&gt;
Thanks for reading!&lt;/p&gt;

</description>
      <category>api</category>
      <category>programming</category>
      <category>dotnet</category>
      <category>mobile</category>
    </item>
  </channel>
</rss>
