<?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 Md.Al-Amin on Medium]]></title>
        <description><![CDATA[Stories by Md.Al-Amin on Medium]]></description>
        <link>https://medium.com/@alamin899?source=rss-84035ecb2f7c------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Y1E2va9pBK4gDkjhNqtGfA.jpeg</url>
            <title>Stories by Md.Al-Amin on Medium</title>
            <link>https://medium.com/@alamin899?source=rss-84035ecb2f7c------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 23:20:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@alamin899/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[How Cloudflare Tunnel Works (Part 2)]]></title>
            <link>https://alamin899.medium.com/how-cloudflare-tunnel-works-part-2-6f14337bc93e?source=rss-84035ecb2f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f14337bc93e</guid>
            <dc:creator><![CDATA[Md.Al-Amin]]></dc:creator>
            <pubDate>Tue, 27 Feb 2024 09:57:09 GMT</pubDate>
            <atom:updated>2024-02-27T09:57:09.323Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Cloudflare Architecture</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*oiMhLfJQQ_gyo0Rz.png" /></figure><p>Cloudflare Tunneling, formerly known as Argo Tunnel, involves several steps and technologies working together to securely expose your local services to the internet. Here’s a step-by-step explanation of the internal process and the technologies involved:</p><p><strong>Cloudflare Tunnel Daemon (Cloudflared):</strong></p><p>Cloudflared is the client-side software that runs on your local machine. It’s responsible for creating and managing the encrypted connection between your machine and Cloudflare’s edge network.<br>Cloudflared is built using Go programming language.</p><p><strong>TLS Handshake:</strong></p><p>When Cloudflared starts, it initiates a TLS handshake with Cloudflare’s edge servers. This handshake establishes a secure, encrypted communication channel using Transport Layer Security (TLS) protocol.<br>TLS ensures that the data exchanged between Cloudflared and Cloudflare’s edge is encrypted and secure.</p><p><strong>WebSocket Connection:</strong></p><p>After the TLS handshake is completed, Cloudflared establishes a WebSocket connection with Cloudflare’s edge.<br>WebSocket is a communication protocol that provides full-duplex communication channels over a single TCP connection. It allows for efficient, bi-directional communication between Cloudflared and Cloudflare’s edge servers.</p><p><strong>Cloudflare Edge Network:</strong></p><p>Cloudflare’s edge network consists of data centers distributed globally. Each data center acts as a point of presence (PoP) where incoming traffic is processed and optimized.<br>Cloudflare’s edge servers handle incoming requests from users and route them to the appropriate destination, including the Cloudflare Tunnel endpoints.</p><p>*<em>Tunnel Endpoint:<br></em><br>Cloudflare assigns a unique tunnel endpoint to each Cloudflared instance running on your local machine. This endpoint acts as the entry point for incoming traffic destined for your local services.<br>The tunnel endpoint is a domain name or a subdomain hosted by Cloudflare.</p><p><strong>Service Discovery:</strong></p><p>You configure Cloudflared to specify which local services you want to expose to the internet. This can include web servers, APIs, or any other TCP-based service running on your machine.<br>Cloudflared dynamically discovers these services and establishes connections to them.</p><p><strong>Encrypted Tunnel:</strong></p><p>Once the WebSocket connection is established and services are discovered, Cloudflared creates an encrypted tunnel between your machine and Cloudflare’s edge network.<br>This tunnel securely forwards incoming traffic from Cloudflare’s edge to the specified local services running on your machine.</p><p><strong>DNS Configuration:</strong></p><p>You configure DNS records on Cloudflare’s platform to point to the tunnel endpoint assigned to your Cloudflared instance.<br>This ensures that incoming traffic to your domain is directed through Cloudflare’s network to your local machine via the established tunnel.</p><p><strong>Traffic Routing:</strong></p><p>When a user accesses your domain, their request is routed through Cloudflare’s global network to the nearest data center.<br>From there, it’s forwarded through the established tunnel to your local machine where your service is hosted.</p><p><strong>Security Features:</strong></p><p>Cloudflare provides various security features such as DDoS protection, Web Application Firewall (WAF), and rate limiting to safeguard your exposed services from malicious attacks and unauthorized access.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f14337bc93e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Local machine as a web server without public IP using Cloudflare tunnel(part-1)]]></title>
            <link>https://alamin899.medium.com/local-machine-as-a-web-server-without-public-ip-using-cloudflare-tunnel-part-1-7b69de3a6dae?source=rss-84035ecb2f7c------2</link>
            <guid isPermaLink="false">https://medium.com/p/7b69de3a6dae</guid>
            <category><![CDATA[cloudflare-tunnel]]></category>
            <category><![CDATA[local-machine]]></category>
            <category><![CDATA[web-server]]></category>
            <dc:creator><![CDATA[Md.Al-Amin]]></dc:creator>
            <pubDate>Tue, 27 Feb 2024 09:51:38 GMT</pubDate>
            <atom:updated>2024-02-27T09:51:38.601Z</atom:updated>
            <content:encoded><![CDATA[<p>we can use our local machine as a public webserver using Cloudflare tunnel. you do not need any public IP.</p><p><strong>Prerequisites</strong></p><ol><li>PC or laptop</li><li>you need a public domain(possible without a domain)</li><li>Cloudflare account</li></ol><p><a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/"><strong>Cloudflare Tunnel</strong></a><br>Cloudflare Tunnel provides you with a secure way to connect your resources to Cloudflare without a publicly routable IP address. With Tunnel, you do not send traffic to an external IP — instead, a lightweight daemon in your infrastructure (‘cloudflared’) creates outbound-only connections to Cloudflare’s global network. Cloudflare Tunnel can connect HTTP web servers, SSH servers, remote desktops, and other protocols safely to Cloudflare</p><h3>Step-1(Install OS)</h3><p>I use Ubuntu OS in my daily work. So I installed an Ubuntu server on my laptop which I will use as a server machine. You can also use another OS (ubuntu-desktop, Mac OS, windows). after installation, you have to ensure that you connect to the internet, after setup internet your machine is ready to serve as web-server.</p><h3>Step-2(Connect your domain with cloudflare)</h3><p>Create a Cloudflare account. after sign up then login in Cloudflare account. After login, you will redirect to the dashboard .From dashboard click add a site button. then enter your domain and submit then you will see name-server ,this name-serve add to your domain registered dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*MMo6mpPo5TAQXrEc.png" /></figure><p>Congratulations your domain and cloudflare are connected now.</p><h3><a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/#1-download-and-install-cloudflared">Step-3(Install Cloudflare in your Linux machine)</a></h3><ul><li>Add Cloudflare’s package signing key:</li></ul><pre>sudo mkdir -p --mode=0755 /usr/share/keyrings<br>curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg | sudo tee /usr/share/keyrings/cloudflare-main.gpg &gt;/dev/null</pre><ul><li>Add Cloudflare’s apt repo to your apt repositories:</li></ul><pre>echo &quot;deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared $(lsb_release -cs) main&quot; | sudo tee /etc/apt/sources.list.d/cloudflared.list</pre><ul><li>Update repositories and install cloudflared:</li></ul><pre>sudo apt-get update &amp;&amp; sudo apt-get install cloudflared</pre><p>After successfully installing Cloudflare check</p><pre>cloudflared -v</pre><blockquote><em>Installing process for other OS — </em><a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/#1-download-and-install-cloudflared"><em>Download And Install</em></a></blockquote><h3><a href="https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/get-started/create-local-tunnel/#2-authenticate-cloudflared">Step-4(Create Tunnel and use)</a></h3><p><strong>1. Authenticate Cloudflare</strong></p><pre>sudo cloudflared tunnel login</pre><p>After this command you will be redirected to your Cloudflare account otherwise you will get a link, then you will use this link after you see the list of domains that you attach to your Cloudflare account. i selected my domain iamalamin.com .<br>after selecting your domain it will create cert.pem file to your machine /root/.cloudflared/ directory</p><p><strong>2. Create a Cloudflare tunnel</strong></p><pre>sudo cloudflared tunnel create &lt;NAME&gt;</pre><p>after this command, you will get a tunnel. this tunnel has &lt;Tunnel-UUID&gt; which is stored in /root/.cloudflared/ directory with &lt;Tunnel-UUID&gt;.json</p><pre>sudo cloudflared tunnel list</pre><p>show the tunnel list in your machine</p><p><strong>3. Create a configure file for my tunnel</strong></p><p>In your /root/.cloudflared directory, create a config.yml file using any text editor. This file will configure the tunnel to route traffic from a given origin to the hostname of your choice.</p><pre>tunnel: &lt;Tunnel-UUID&gt;<br>credentials-file: /root/.cloudflared/&lt;Tunnel-UUID&gt;.json<br>ingress:<br>  - hostname: example-app.com<br>    service: http://localhost:3000<br>    originRequest:<br>      noTLSVerify: true<br>  - service: http_status:404</pre><p>Here service: http://localhost:3000 this is your local application running URL.</p><p><strong>4. Start routing traffic</strong></p><p>Now assign a CNAME record that points traffic to your tunnel subdomain:</p><pre>sudo cloudflared tunnel route dns &lt;Tunnel-UUID&gt; &lt;your-domain-name&gt;</pre><p>After this command a CNAME record will be created in your Cloudflare account domain dashboard. When I visited the Cloudflare dashboard Websites &gt; your-domain.com &gt; DNS &gt; Records I saw that a new CNAME record was added to my domain&#39;s DNS record. This was added by the command I ran.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*bpIMlSmS6QxZ8HRX.png" /></figure><p><strong>5. Run the tunnel</strong></p><pre>sudo cloudflared tunnel run &lt;Tunnel-UUID or NAME&gt;</pre><p>You need to always run this command to access your application using this tunnel.</p><p><strong>6. Run Cloudflare as a service</strong></p><p>To always run your Cloudflare you can use Cloudflare service on your machine.</p><pre>sudo cloudflared service install<br>sudo systemctl start cloudflared<br>sudo systemctl status cloudflared</pre><blockquote><em>Now your application will run from your local machine publicly using cloudflare tunnel</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7b69de3a6dae" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>