<?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>Forem: Navdeep Singh Rathore</title>
    <description>The latest articles on Forem by Navdeep Singh Rathore (@nsrcodes).</description>
    <link>https://forem.com/nsrcodes</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%2F475921%2F9af1feb0-4520-4e39-ab8a-69ca0b140cef.png</url>
      <title>Forem: Navdeep Singh Rathore</title>
      <link>https://forem.com/nsrcodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/nsrcodes"/>
    <language>en</language>
    <item>
      <title>Debugging problems in a deeply nested javascript dependency</title>
      <dc:creator>Navdeep Singh Rathore</dc:creator>
      <pubDate>Sat, 22 Oct 2022 09:59:53 +0000</pubDate>
      <link>https://forem.com/nsrcodes/when-a-deeply-nested-dependency-halts-a-release-158l</link>
      <guid>https://forem.com/nsrcodes/when-a-deeply-nested-dependency-halts-a-release-158l</guid>
      <description>&lt;p&gt;I was about to release a new patch version of the desktop app that I am working on and once the changes were ready, I decided to bump the npm version and do some final sanity checks&lt;br&gt;
I first ran &lt;code&gt;npm i&lt;/code&gt; and then &lt;code&gt;npm start&lt;/code&gt;. And as I waited for the app launch, something felt off this time, and a quick look at the terminal showed what was wrong &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AewPafhG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glmym0v1vvu04xh3o4of.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AewPafhG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/glmym0v1vvu04xh3o4of.png" alt="nested dependency error after running  raw `npm i` endraw " width="880" height="212"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;keyv&lt;/code&gt;? This was not a package from my source code, and nor did I add any extra dependencies, so why now? what changed....&lt;/p&gt;
&lt;h2&gt;
  
  
  What changed in the peer dependency? (&lt;em&gt;that I never knew I was using&lt;/em&gt;)
&lt;/h2&gt;

&lt;p&gt;I still don't completely know what this package does but that isn't important&lt;/p&gt;

&lt;p&gt;&lt;code&gt;keyv&lt;/code&gt; is a package that is used by &lt;code&gt;cacheable-request&lt;/code&gt; which is used by the famous HTTP client &lt;code&gt;GOT&lt;/code&gt;. &lt;code&gt;keyv&lt;/code&gt; now provides its own type definitions, so you don't need @types/keyv package as a dev dependency anymore. &lt;/p&gt;

&lt;p&gt;Understandably, the &lt;a href="https://github.com/DefinitelyTyped/DefinitelyTyped"&gt;DefinatelyTyped&lt;/a&gt; team, one that maintains the &lt;code&gt;@type&lt;/code&gt; modules, decided to remove the types for keyv since everything had been stable for a while now.&lt;br&gt;
&lt;a href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/62741"&gt;The PR&lt;/a&gt; removes not just the &lt;code&gt;keyv&lt;/code&gt; types but also it's reference inside the types of other packages that depended on it&lt;/p&gt;

&lt;p&gt;But legacy projects that still either ran on node 14 (which does not easily provide support for the new ESM modules) or were just somehow using an older version of keyv as a nested dependency still needed @types/keyv &lt;/p&gt;

&lt;p&gt;My fixation on this random "patch-fix" of a probably unheard package, started not because I was using an old version of GOT, but rather an old version of electron builder, which in turn was using an old version of GOT&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uJmfDTC8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh1t4h4sd14mxtdm1ubc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uJmfDTC8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/eh1t4h4sd14mxtdm1ubc.png" alt="npm module dependency tree" width="880" height="181"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;(&lt;em&gt;You see how deep this story goes!&lt;/em&gt;)&lt;/p&gt;

&lt;p&gt;The reason for the bug is obvious now if you know how typescript references types for modules. If the package does not have an &lt;code&gt;[filename].d.ts&lt;/code&gt;, the file's type definition are not available. &lt;br&gt;
This was what DefinatelyTyped solved by providing the @types module. &lt;br&gt;
So the packages that still referenced this old @types/keyv module broke once &lt;a href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/62741"&gt;this PR&lt;/a&gt; was merged a few days back&lt;/p&gt;
&lt;h2&gt;
  
  
  What actually went wrong?
&lt;/h2&gt;

&lt;p&gt;So first of all this could be easily considered a breaking change and should not have been released as a patch version,&lt;br&gt;
as pointed out in &lt;a href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/62741#issuecomment-1284002918"&gt;this comment&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I think &lt;code&gt;cacheable-request&lt;/code&gt;, which again I did not know we depended on, had "*" as the version for &lt;code&gt;keyv&lt;/code&gt; in its &lt;code&gt;package.json&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;So everyone ended up upgrading to this package and now everything breaks&lt;/p&gt;
&lt;h2&gt;
  
  
  Solution: Pinning Dependency version
&lt;/h2&gt;

&lt;p&gt;As mentioned in the referenced issue, you can pin the package to a particular version using &lt;a href="https://docs.npmjs.com/cli/v8/configuring-npm/package-json"&gt;overrides&lt;/a&gt; inside package.json&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"overrides" : {
    "@types/keyv": "3.1.4"
  },
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But the better thing would be to just update all your dependencies. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you haven't done this for some time now, something like &lt;a href="https://www.npmjs.com/package/npm-check-updates"&gt;&lt;code&gt;npm-check-upgrades&lt;/code&gt;&lt;/a&gt;. I find myself referencing this article from freecodecamp every time I have to do so - &lt;a href="https://www.freecodecamp.org/news/how-to-update-npm-dependencies/"&gt;https://www.freecodecamp.org/news/how-to-update-npm-dependencies/&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;TIL: "*" as a dependency version is a disaster waiting to happen. If not for you, then for the people using your code.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>npm</category>
      <category>node</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Packets and Frames in libav transcoding pipeline</title>
      <dc:creator>Navdeep Singh Rathore</dc:creator>
      <pubDate>Wed, 29 Dec 2021 07:19:12 +0000</pubDate>
      <link>https://forem.com/nsrcodes/packets-and-frames-in-libav-transcoding-pipeline-d0h</link>
      <guid>https://forem.com/nsrcodes/packets-and-frames-in-libav-transcoding-pipeline-d0h</guid>
      <description>&lt;p&gt;I found it a bit confusing to identify when to use &lt;code&gt;AVFrame&lt;/code&gt; and when to use &lt;code&gt;AVPacket&lt;/code&gt; while working with libav.&lt;/p&gt;

&lt;p&gt;TLDR; Packets contain encoded data. Frames contain decoded data&lt;/p&gt;

&lt;p&gt;That is the only difference between packets and frames but it is the core reason for their differences in attributes and the stage in which they are produced in a transcoding pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  Let us understand this with an example
&lt;/h2&gt;

&lt;p&gt;Taking referrence from the famous &lt;a href="https://github.com/leandromoreira/ffmpeg-libav-tutorial#chapter-3---transcoding"&gt;libav tutorial on github&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--CgsUZfNi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/leandromoreira/ffmpeg-libav-tutorial/master/img/transcoding_flow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--CgsUZfNi--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/leandromoreira/ffmpeg-libav-tutorial/master/img/transcoding_flow.png" alt="Trancoding pipeline" width="880" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The &lt;strong&gt;AVFormatContext&lt;/strong&gt; is the abstraction for the format of the media file, aka container (ex: MKV, MP4, Webm, TS). The &lt;strong&gt;AVStream&lt;/strong&gt; represents each type of data for a given format (ex: audio, video, subtitle, metadata). The &lt;strong&gt;AVPacket&lt;/strong&gt; is a slice of compressed data obtained from the &lt;code&gt;AVStream&lt;/code&gt; that can be decoded by an &lt;strong&gt;AVCodec&lt;/strong&gt; (ex: av1, h264, vp9, hevc) generating a raw data called &lt;strong&gt;AVFrame&lt;/strong&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;To implement this, we use the following functions (in this order)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;avcodec_send_packet&lt;/code&gt; to send an encoded packet to the decoder&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;avcodec_receive_frame&lt;/code&gt; to recieve a raw frame from the decoder

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We then perform any modifications such as scaling, resampling, cropping, format conversion, etc. on the raw frame.&lt;br&gt;
Remember to keep the frames compatible for the encoder being used.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;avcodec_send_frame&lt;/code&gt; to send a raw frame to the encoder&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;avcodec_receive_packet&lt;/code&gt; to recieve an encoded packet from the encoder

&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But this also has further intricacies like:&lt;/p&gt;

&lt;h3&gt;
  
  
  Multiple frames in single packet
&lt;/h3&gt;

&lt;p&gt;A (&lt;em&gt;encoded&lt;/em&gt;) packet could contain multiple (&lt;em&gt;raw&lt;/em&gt;) frames while. This can occur separately while encoding and decoding and depends on the attributes of the codec (&lt;code&gt;AVCodecContext&lt;/code&gt;). &lt;br&gt;
Hence it is a good idea to use &lt;code&gt;avcodec_receive_frame&lt;/code&gt; inside a loop and read frames till it does not return an error, specifically &lt;code&gt;AVERROR(EAGAIN)&lt;/code&gt;, that signals that the internal buffer (of the codec) is now empty.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;avcodec_decode_*&lt;/code&gt; and &lt;code&gt;avcodec_encode_*&lt;/code&gt; methods
&lt;/h3&gt;

&lt;p&gt;It can be confusing to find these methods being used in other libav projects/scripts to build a complete transcoding workflow with fewer function calls. &lt;br&gt;
But, as mentioned &lt;a href="https://ffmpeg.org/doxygen/3.2/group__lavc__encdec.html"&gt;here&lt;/a&gt; the above mentioned workflow of packets and frames is meant to replace these legacy functions.&lt;/p&gt;

</description>
      <category>multimedia</category>
      <category>tutorial</category>
      <category>learning</category>
      <category>ffmpeg</category>
    </item>
    <item>
      <title>Setting network proxy on linux desktop</title>
      <dc:creator>Navdeep Singh Rathore</dc:creator>
      <pubDate>Mon, 20 Dec 2021 18:44:15 +0000</pubDate>
      <link>https://forem.com/nsrcodes/setting-network-proxy-on-linux-desktop-c7</link>
      <guid>https://forem.com/nsrcodes/setting-network-proxy-on-linux-desktop-c7</guid>
      <description>&lt;p&gt;I was trying to write a script to setup system wide proxy on my Ubuntu desktop. Turns out, Linux makes it way too difficult to configure a proxy across &lt;em&gt;all&lt;/em&gt; apps. &lt;/p&gt;

&lt;h1&gt;
  
  
  Table of Contents
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;App Specific Proxies&lt;/li&gt;
&lt;li&gt;Gnome network settings&lt;/li&gt;
&lt;li&gt;Using Environment Variables&lt;/li&gt;
&lt;li&gt;Configure Firewall&lt;/li&gt;
&lt;/ul&gt;



&lt;h2&gt;
  
  
  0. Setting app specific proxies &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Most web browsers (&lt;em&gt;Firefox in particular&lt;/em&gt;) have their own internal proxy settings. There is abundant documentation for all of these on their respective websites.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Gnome network settings &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;If you are using Gnome, you can go to &lt;code&gt;Settings &amp;gt; Network &amp;gt; Network Proxy&lt;/code&gt;. Select &lt;code&gt;Manual&lt;/code&gt; and enter the proxy details.&lt;/p&gt;

&lt;p&gt;This the most obvious method and it covers most general use cases like using a proxy for WiFi inside a corporate or university network.&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%2F447xnzvwb8uyni3zxtca.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%2F447xnzvwb8uyni3zxtca.png" alt="Gnome Network settings"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Under the hood, this sets attributes in &lt;code&gt;gconf&lt;/code&gt;(&lt;em&gt;maybe &lt;code&gt;dconf&lt;/code&gt; in modern distros&lt;/em&gt;). This can be done from the terminal as:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

gsettings &lt;span class="nb"&gt;set &lt;/span&gt;org.gnome.system.proxy mode &lt;span class="s1"&gt;'manual'&lt;/span&gt;
gsettings &lt;span class="nb"&gt;set &lt;/span&gt;org.gnome.system.proxy.http enabled &lt;span class="nb"&gt;true
&lt;/span&gt;gsettings &lt;span class="nb"&gt;set &lt;/span&gt;org.gnome.system.proxy.http host &lt;span class="s1"&gt;'proxy.server.addr'&lt;/span&gt;
gsettings &lt;span class="nb"&gt;set &lt;/span&gt;org.gnome.system.proxy.http port proxy_port


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  2. Setting environment variables &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;The previous method does not always work for shell instances. A proven way for using a proxy while working on the terminal (either while doing a simple curl, or while launching an app) is by setting environment variables like &lt;code&gt;http_proxy&lt;/code&gt; or &lt;code&gt;HTTP_PROXY&lt;/code&gt; to set a proxy for all http request. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; you might want to set both the uppercase and the lowercase version. This is necessary because, without a proper standard, over the years apps and languages either support both (with a set of priorities) or any one of the two. This leads to some long, head scratching debugging sessions, like &lt;a href="https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/" rel="noopener noreferrer"&gt;this one&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can either do this for each shell instance like:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nv"&gt;http_proxy&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"username:password@proxy_address:port"&lt;/span&gt; 
curl http://www.example.com

&lt;span class="c"&gt;# you can skip the authentication part for an open proxy&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;or be smart guy, and export this and other relevant variables inside &lt;code&gt;.bashrc&lt;/code&gt; (or maybe &lt;code&gt;.zshrc&lt;/code&gt;) as&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

export http_proxy="http://$username:$password@$proxy_address:$port"
export HTTP_PROXY="http://$username:$password@$proxy_address:$port"


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;By other relavant variables, I mean&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;https_proxy&lt;/code&gt; / &lt;code&gt;HTTPS_PROXY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ftp_proxy&lt;/code&gt; / &lt;code&gt;FTP_PROXY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;no_proxy&lt;/code&gt; / &lt;code&gt;NO_PROXY&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rsync_proxy&lt;/code&gt; / &lt;code&gt;RSYNC_PROXY&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;To check if these variables have been set properly, you can run the following:&lt;br&gt;
&lt;code&gt;set | grep -i proxy&lt;/code&gt;&lt;br&gt;
Similarly, these can be unset individually when required with &lt;code&gt;unset http_proxy&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Bonus&lt;/strong&gt;&lt;br&gt;
If you feel like all this is too much, you can use a tool like (ProxyMan)[&lt;a href="https://github.com/himanshub16/ProxyMan/" rel="noopener noreferrer"&gt;https://github.com/himanshub16/ProxyMan/&lt;/a&gt;] that is a lightweight shell script with a simple interface to both set and unset these variables. &lt;/p&gt;

&lt;p&gt;This also does advanced steps like setting a proxy for commands like &lt;code&gt;apt update&lt;/code&gt;, if you require. &lt;br&gt;
This is done by adding the following to &lt;code&gt;/etc/apt/apt.conf&lt;/code&gt; &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;

Acquire::http::Proxy "http://username:password@proxy_address:port";


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You can go even further with tools like &lt;a href="https://github.com/haad/proxychains" rel="noopener noreferrer"&gt;proxychains&lt;/a&gt; that let you chain multiple proxies. This is used while setting up tor and comes pre-installed with pentesting distros like Kali and ParrotOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Using iptables &lt;a&gt;&lt;/a&gt;
&lt;/h2&gt;

&lt;p&gt;Most general use cases will be satisfied by the above 2 steps. &lt;br&gt;
Even if you need to setup something like your own &lt;a href="https://docs.mitmproxy.org/stable/concepts-howmitmproxyworks/" rel="noopener noreferrer"&gt;man-in-the-middle proxy&lt;/a&gt; like &lt;a href="https://mitmproxy.org/" rel="noopener noreferrer"&gt;mitm&lt;/a&gt; or a &lt;a href="https://www.imperva.com/learn/ddos/transparent-proxy/" rel="noopener noreferrer"&gt;transparent proxy&lt;/a&gt; like squid for simple logging, you could still use the previous step and launch apps from the terminal while setting the required variables to point to the proxy server &lt;br&gt;
That does, &lt;em&gt;mostly&lt;/em&gt;, work.&lt;/p&gt;

&lt;p&gt;But what if you want to send &lt;strong&gt;all&lt;/strong&gt; of your system's traffic through your proxy? &lt;br&gt;
To setup a system wide proxy, most google searches will lead you to answers on stack-exchange that recommend some form of method #2. \&lt;br&gt;
But, as stated in the &lt;a href="https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/" rel="noopener noreferrer"&gt;Gitlab blog&lt;/a&gt; it does not always work, and is also a source of unwanted bugs.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Full disclaimer:&lt;/strong&gt; I haven't tried this properly myself and am also fairly new to using iptables. But, it seems like the only valid approach out there that tries to solve this specific problem&lt;br&gt;
I have kept my explanation; &lt;em&gt;based on my rudimentary understanding&lt;/em&gt;; as short as possible&lt;br&gt;
&lt;strong&gt;Please reference the post mentioned below for a better explanation&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;code&gt;iptables&lt;/code&gt; is a tool provided by &lt;a href="https://www.netfilter.org/" rel="noopener noreferrer"&gt;netfilter&lt;/a&gt; that is used to configure custom firewalls on your system.&lt;/p&gt;

&lt;p&gt;For our use case, we can mark all our out going network packets from a certain user and forward it to the process running our proxy.&lt;/p&gt;

&lt;p&gt;Make sure that the proxy is running under a separate user, so as to prevent the proxy from intercepting its own output.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Step-by-step instructions&lt;/em&gt; - &lt;a href="https://serverfault.com/a/674389/946308" rel="noopener noreferrer"&gt;https://serverfault.com/a/674389/946308&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Some references online that helped me
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://unix.stackexchange.com/a/213740/428441" rel="noopener noreferrer"&gt;https://unix.stackexchange.com/a/213740/428441&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wiki.archlinux.org/title/Proxy_server" rel="noopener noreferrer"&gt;https://wiki.archlinux.org/title/Proxy_server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://discourse.mitmproxy.org/t/transparent-proxying-on-a-single-machine-iptables/97" rel="noopener noreferrer"&gt;https://discourse.mitmproxy.org/t/transparent-proxying-on-a-single-machine-iptables/97&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/" rel="noopener noreferrer"&gt;https://about.gitlab.com/blog/2021/01/27/we-need-to-talk-no-proxy/&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>linux</category>
      <category>proxy</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
