Show HN: Mmar – open-source, zero-dependancy, cross-platform HTTP tunneling

github.com

15 points by ymusleh 4 months ago

Hey HN!

For the past couple of months, I've been working on and off on a cool project I'm excited to share.

mmar (pronounced "ma-mar") is an open-source, zero dependency, cross platform and self-hostable HTTP tunnel built in Go. It allows you to easily expose your localhost to the world on a public URL.

You can easily create an HTTP tunnel right away for free on a randomly generated subdomain on "*.mmar.dev" if you don't feel like self-hosting.

This isn't something new, in fact there's quite a few of alternative HTTP tunneling tools out there. mmar is my attempt to optimize for a super easy developer experience and simplified implementation. None the less, I had a blast building it and I think developers could find it pretty useful.

Additionally, I documented the whole process of building mmar through devlogs. You can read about the thought process and implementation details here (https://ymusleh.com/tags/mmar.html).

If I would suggest one devlog to read, I highly recommend devlog 5 (https://ymusleh.com/mmar-devlog-005.html). I describe how I built a (very) basic DNS server just to run simulation tests for mmar (a bit of an overkill, but a fantastic learning experience). I dive deep into the DNS protocol and explain why I needed to implement it.

Finally, I would love to hear your thoughts and feedback. If you try mmar out, let me know!

fuzzfactor 4 months ago

I like the looks of this, maybe I will be able to try it out.

Edit: Would be good if there was a 32-bit x86 binary for Windows.

  • ymusleh 4 months ago

    I just created a new release that has a 32-bit x86 binary for Windows. Feel free to check it out: https://github.com/yusuf-musleh/mmar/releases/tag/v0.2.4

    • fuzzfactor 4 months ago

      You're amazing.

      Just have been trying it out on bare metal on Windows 10, using VLC as a local media server.

      PCs on the LAN can play the (server VLC's http) stream like normal to begin with, by opening their audio player to a Network Stream or URL, without any browser.

      On my own fully accessible & controllable router/modem, port-forwarding 8080 alone for only TCP allows PCs on the web to access the stream from the modem's WAN IP address:8080/streamname. This is extremely reliable.

      But without port-forwarding on the router, running mmar on the server PC I can see the tunnel to port 8080 on your subdomain, but have not had any luck reaching the VLC media from that address on the web.

      From what I understand, VLC may only support http and not https, maybe that is the problem?

      Also the (simple audio) media stream from VLC has a :portnumber/streamname of :8080/mmarRadio without any file extension. There is no index.html or anything else exposed.

      Then tried a low-resolution MPG2 stream with a .MPG file extension which also streams normally when port-forwarded, the mediaplayer on the remote PC acts more like it wants to connect but then fails and reports it can not open the file. Much more significant buffering on the video stream though.

      When it's my own router, I port-forward a range from 8080 - 8083, to a single mediaserver PC to provide 4 streams simultaneously from that one PC. So streams appear on the single WAN IP address of my modem, accessible from the web, with a choice of 4 ports, acting logically as 4 different Network URLs. All raw numerical IP addresses, no DNS or anything.

      It really does look nominal from the Windows command line, I'll leave 8080 in its "apparently tunneling" condition, going to get some rest for a while.

      • ymusleh 4 months ago

        > You're amazing.

        Thanks, I appreciate you taking the time to check out mmar.

        > But without port-forwarding on the router, running mmar on the server PC I can see the tunnel to port 8080 on your subdomain, but have not had any luck reaching the VLC media from that address on the web.

        I haven't tested HTTP streaming using mmar, however taking a look at the logs, I can see a bunch of i/o timeouts, so it's likely the case the HTTP streaming doesn't work properly with mmar currently.

        Do you have any suggestions off the top of your head for a small project that has HTTP streaming that I can run locally to test? If not, that's fine, I can figure something out to reproduce the issue.

        • fuzzfactor 4 months ago

          Try VLC, it's an open-source media streaming server as well as a media player.

          Linux focused with decent functioning on the Windows version too.

          Plays or streams lots of codecs but has many limitations.

          MP3's are fairly easy though.

          In Windows I suggest carefully installing VLC to a folder you make yourself, such as C:\VLC. It doesn't do very well if allowed to install to its default "Program Files" location, seems it doesn't like a space in the foldername. VLC will want an exception in the Windows Firewall which I enable.

          There are extensive VLC settings, but defaults will serve (or play) an MP3 stream right out of the box. In Windows you may not be able to hear anything on the local server speakers without selecting DirectX, but regardless VLC will still serve the streaming files, even without audio hardware on the server PC.

          There is a stream "wizard" that can be gone through to end up with a command-line which launches VLC streams accordingly.

          There are a lot of options, I narrow it down as follows:

          Even in Windows I respect the case-sensitive filenames, always including the .exe extension too:

          C:\VLC\vlc.exe C:\mp3s\example.mp3 --sout #duplicate{dst=http{mux=mp3,dst=:8080/mmarRadio},dst=display} :no-sout-all :sout-keep

          This launches VLC, streams the example mp3 to port 8080 with a streamname of mmarRadio, and duplicates the stream to the "display" which is really the PC audio since it's not a video stream. That way you can listen to it on the server's speakers simultaneously.

          On the main VLC window there is a button to make the media repeat indefinitely too, good for testing.

          On a remote PC, you can use VLC to listen by Opening a Network Stream from the File menu, and entering the numerical IP address of the media server:

          http://ipaddress:8080/mmarRadio

          Windows Media Player plays the stream at this address by "Open URL", in Linux the mp3 stream opens on Celluloid with "Open Location".

          There is no file extension for the streamname, the IP address is either the LAN address if local, or the web address of the modem/router whose port 8080 is being forwarded to the mediaserver PC. Web address can be numerical too if there is no DNS. ipv4 is where this is really needed, I disable ipv6 for testing.

          • ymusleh 4 months ago

            Great, thanks for all the pointers. I'll give them a shot and look into it later this week. And hopefully can get back to you soon with a fix.

            • fuzzfactor 4 months ago

              I have great confidence this is going to work!

  • ymusleh 4 months ago

    Hey, thanks for checking it out! I'm looking into adding the 32 bit binary for Windows, stayed tuned.

    Meanwhile, if you have docker installed you could also try it out using the docker instructions if you'd like.