Skip to content

Add HTTP/S share support#12

Merged
averne merged 7 commits intoaverne:masterfrom
ViRb3:http
Feb 24, 2026
Merged

Add HTTP/S share support#12
averne merged 7 commits intoaverne:masterfrom
ViRb3:http

Conversation

@ViRb3
Copy link
Contributor

@ViRb3 ViRb3 commented Feb 23, 2026

This PR adds support for HTTP/S shares, the same way as existing SMB, NFS and SFTP. I tested this extensively and saw no issues: nginx/copyparty/Apache autoindex, jpeg/mp4/mkv playback, video, audio, subtitles, skipping back and forth, file metadata parsing via ZL/ZR (ffmpeg).

You will notice that a lot of the FS commands like stat, seek, etc. are not implemented. I tested two approaches here:

  1. Implementing all interfaces and fetching chunks directly via curl, passing them to mpv as data
  2. The PR approach, by implementing a minimal FS for browsing the directories, then feeding the URL to mpv and letting it do everything.

I found out that the 2nd approach had a lot faster skipping/scrubbing, buffering, and most importantly, a consistent 10% less CPU usage. I compared with nxmp, which also takes approach 2, and the CPU usage was basically identical.

I did not add size parsing since there's no good way to do it reliably across all autoindex providers.

NOTE: AI was used to help with this PR since I was not familiar with the codebase. I reviewed and tested the code to the best of my abilities, but please definitely check it out as well.

You can test my build here: https://github.com/ViRb3/SwitchWave/actions/runs/22315408241/artifacts/5620623670

Leaving as draft until #11 is merged, as this is based on top of it.

@ViRb3
Copy link
Contributor Author

ViRb3 commented Feb 23, 2026

PR merged and rebased, ready for review.

@ViRb3 ViRb3 marked this pull request as ready for review February 23, 2026 18:02
@averne
Copy link
Owner

averne commented Feb 23, 2026

Nice, will take a closer look this evening

@ViRb3
Copy link
Contributor Author

ViRb3 commented Feb 23, 2026

Pushed an extra tiny commit that renders the full name of directories in the side panel, same as files. Currently, long directory names get truncated and there's no way to see them.

Copy link
Owner

@averne averne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, overall this looks very good. I have a few comments, mostly cosmetic change.
The only thing that really needs to be fixed is the handling of the devoptab's internal directory state, but I think the confusion stems from a bug in my existing SMB/NFS code.

I didn't have it in myself to give a proper look at the HTML parsing code, so I'll trust your testing on that.

@ViRb3
Copy link
Contributor Author

ViRb3 commented Feb 24, 2026

Rebased and pushed some new commits, please check them that way for easier review.

Wanted to discuss a choice of behavior with you - currently, SwitchWave will send basic auth preemptively everywhere, without waiting for server challenge. This will make it work with servers which redirect to login portal instead of sending challenge, at the cost of potentially sending credentials even if the server doesn't need them. Worst case, I guess this would send credentials if the user typos the server, but IMO it's quite hypothetical. Do you think this is a reasonable tradeoff?

@averne
Copy link
Owner

averne commented Feb 24, 2026

Wanted to discuss a choice of behavior with you - currently, SwitchWave will send basic auth preemptively everywhere, without waiting for server challenge. This will make it work with servers which redirect to login portal instead of sending challenge, at the cost of potentially sending credentials even if the server doesn't need them. Worst case, I guess this would send credentials if the user typos the server, but IMO it's quite hypothetical. Do you think this is a reasonable tradeoff?

Yes, I think that's fine

@ViRb3
Copy link
Contributor Author

ViRb3 commented Feb 24, 2026

This should be all comments addressed now.

@averne
Copy link
Owner

averne commented Feb 24, 2026

Great, thanks again for your work

@averne averne merged commit 5791985 into averne:master Feb 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants