[GH-ISSUE #69] When to use mitm vs normal mode? #187

Open
opened 2026-03-01 17:43:42 +03:00 by kerem · 6 comments
Owner

Originally created by @kbirger on GitHub (May 26, 2022).
Original GitHub issue: https://github.com/AnanthVivekanand/spotify-adblock/issues/69

The readme explains how to use mitm.js, but not what it is used for, how it's different, or what the advantages are over index.js

Can someone clarify these points for me please?

Originally created by @kbirger on GitHub (May 26, 2022). Original GitHub issue: https://github.com/AnanthVivekanand/spotify-adblock/issues/69 The readme explains how to use mitm.js, but not what it is used for, how it's different, or what the advantages are over index.js Can someone clarify these points for me please?
Author
Owner

@3N4N commented on GitHub (Dec 10, 2022):

mitm uses a library 'http-mitm-proxy', whereas index manually creates the HTTP request. But otherwise they should behave the same.

The practical difference is that index hasn't been updated for a long time. Mitm has been the focus of this git repo. Which wouldn't be a big problem, except these two programs use separate white and black lists. If these lists were the same for both, they would virtually behave the same.

Wanna shed some light as to why the whitelists for index and mitm are different, @AnanthVivekanand?

<!-- gh-comment-id:1345152540 --> @3N4N commented on GitHub (Dec 10, 2022): mitm uses a library 'http-mitm-proxy', whereas index manually creates the HTTP request. But otherwise they should behave the same. The practical difference is that index hasn't been updated for a long time. Mitm has been the focus of this git repo. Which wouldn't be a big problem, except these two programs use separate white and black lists. If these lists were the same for both, they would virtually behave the same. Wanna shed some light as to why the whitelists for index and mitm are different, @AnanthVivekanand?
Author
Owner

@AnanthVivekanand commented on GitHub (Dec 10, 2022):

They don't behave the same -- http-mitm-proxy allows mitm.js to access the full url of all requests. There are some domains that serve both audio and ads, and since mitm.js has access to the full urls, it's able to filter ads while allowing audio through. Refer to blacklist.js (https://github.com/AnanthVivekanand/spotify-adblock/blob/master/blacklist.js) you'll see filtering by exact path rather than just by domain.

There's some more complicated stuff also going on with login5.spotify.com which you can find discussion about here: https://github.com/AnanthVivekanand/spotify-adblock/pull/7#issuecomment-618537177

But yes, I'll update README.md about mitm.js. I think I will rename index.js and move it a deprecated folder or something.

<!-- gh-comment-id:1345403889 --> @AnanthVivekanand commented on GitHub (Dec 10, 2022): They don't behave the same -- `http-mitm-proxy` allows `mitm.js` to access the full url of all requests. There are some domains that serve both audio and ads, and since `mitm.js` has access to the full urls, it's able to filter ads while allowing audio through. Refer to `blacklist.js` (https://github.com/AnanthVivekanand/spotify-adblock/blob/master/blacklist.js) you'll see filtering by exact path rather than just by domain. There's some more complicated stuff also going on with `login5.spotify.com` which you can find discussion about here: https://github.com/AnanthVivekanand/spotify-adblock/pull/7#issuecomment-618537177 But yes, I'll update README.md about `mitm.js`. I think I will rename index.js and move it a `deprecated` folder or something.
Author
Owner

@AnanthVivekanand commented on GitHub (Dec 10, 2022):

Alright, I've updated README.md with some explanations. @3N4N

<!-- gh-comment-id:1345411085 --> @AnanthVivekanand commented on GitHub (Dec 10, 2022): Alright, I've updated README.md with some explanations. @3N4N
Author
Owner

@3N4N commented on GitHub (Dec 11, 2022):

@AnanthVivekanand thanks for the clarification. I would like to propose an addition to the readme, however. It says, "On the first run, mitm.js generates a Root Certificate Authority (CA), which needs to be trusted by the OS." Most people will be unfamiliar with this process (I have read about CA, but never configured it in either of my Windows or Linux machines). You may consider adding a tutorial, or at least a link to some trusted tutorial, teaching people. I followed this YT walkthrough: https://youtu.be/CqkPraRDuHY, and can confirm it works. See if it's a good enough approach to be linked in your readme.

Also, add a CA trusting tutorial for Linux users as well. I'll try finding a way to do it in Ubuntu when I'm on my Linux machine, but it will be late.

<!-- gh-comment-id:1345455696 --> @3N4N commented on GitHub (Dec 11, 2022): @AnanthVivekanand thanks for the clarification. I would like to propose an addition to the readme, however. It says, "On the first run, `mitm.js` generates a Root Certificate Authority (CA), which needs to be trusted by the OS." Most people will be unfamiliar with this process (I have read about CA, but never configured it in either of my Windows or Linux machines). You may consider adding a tutorial, or at least a link to some trusted tutorial, teaching people. I followed this YT walkthrough: https://youtu.be/CqkPraRDuHY, and can confirm it works. See if it's a good enough approach to be linked in your readme. Also, add a CA trusting tutorial for Linux users as well. I'll try finding a way to do it in Ubuntu when I'm on my Linux machine, but it will be late.
Author
Owner

@AnanthVivekanand commented on GitHub (Dec 12, 2022):

Sounds good -- propose a PR with a markdown link for Windows users next to the command I already have for MacOS users and I'll review it. @3N4N

<!-- gh-comment-id:1345826692 --> @AnanthVivekanand commented on GitHub (Dec 12, 2022): Sounds good -- propose a PR with a markdown link for Windows users next to the command I already have for MacOS users and I'll review it. @3N4N
Author
Owner

@3N4N commented on GitHub (Dec 12, 2022):

@AnanthVivekanand I sent a patch to your gmail account logged in this repo. I didn't want to create a fork for a readme patch.

In case your gmail address is incorrect, the patch can also be found here: http://sprunge.us/ZA87WD.

<!-- gh-comment-id:1346026456 --> @3N4N commented on GitHub (Dec 12, 2022): @AnanthVivekanand I sent a patch to your gmail account logged in this repo. I didn't want to create a fork for a readme patch. In case your gmail address is incorrect, the patch can also be found here: http://sprunge.us/ZA87WD.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-adblock#187
No description provided.