19 ms·
Show HN: I made an open-source Bitly alternative
- medv 4y agoHere’s mine: https://ï.at https://xn--gda.at
- medv 4y agoApparently HN replaces ï.at to xn-
- briandoesdev 4y agoDidn't think they'd handle punycode like that.
- dicknuckle 4y agoxn-- for me
- steventey 4y agoFunny thing – I actually had to do some regex validation for domain submissions from users and this was one of the edge cases I had to account for haha Here's the regex that I ended up with: https://github.com/steven-tey/dub/blob/main/lib/utils.ts#L124-L126 https://github.com/steven-tey/dub/blob/main/lib/utils.ts#L12...
- waynesonfire 4y agoin rust?
- agucova 4y agoI literally spent all day Tuesday trying to find a decent alternative to bit.ly. I'm so glad this exists.
- bluelightning2k 4y agoIf you're spending a day why not just roll your own?
- joshmanders 4y agoBecause it takes longer than a day to build?
- intelVISA 4y agoOnly if you take a 12hr lunch (can happen)
- agentdrtran 4y agoHave you looked at Kutt?
- steventey 4y agoSo glad to hear that!!
- srhngpr 4y agoI have been using https://github.com/YOURLS/YOURLS https://github.com/YOURLS/YOURLS for years without any issues
- mnemnc 4y agoThis looks nice! I recently deployed my own Rallly instance (Doodle alternative) via docker-compose and would love to give dub.sh a try. Any plans for releasing a docker version?
- steventey 4y agoNo plans yet, but you can easily clone this repo and deploy your own version on platforms like Vercel.com, no docker containers required! :)
- Rafsark 4y agoIs there a special thing to prevent being blocked from most platforms? For instance, if I post your shortlink on HackerNews, can I be marked as "dupe"
- jackson1442 4y agoDo you have any mechanisms to handle abuse? That's a common problem in the URL shortener space, and usually leads to them getting blocked from most platforms.
- steventey 4y agoYeah I was thinking about that right before launching last night, gonna go ahead and add some simple abuse prevention measures now! My first idea is blacklisting certain problematic hostnames and not let folks add them. Can you think of any other abuse vectors?
- TonyTrapp 4y ago> Can you think of any other abuse vectors? Just be prepared that your service will be (ab)used for linking to malware, pirated content, porn.
- robin_reala 4y agoI really hate link shorteners, because they inevitably die and leave a spray of broken links over the web. What’s wrong with normal URLs?
- bluetidepro 4y ago>What’s wrong with normal URLs? Length (in many contexts). Agree or disagree, but that answers your question for the "why" from what I have seen in my experience. Marketing wants to link to something sexy like "te.st/dog" vs "news.ycombinator.com/item?id=32939407". Many sites may have longer url structures (esp nested structures) for various reasons that are not easy to remember or sexy to have on an ad, so when it's short it's easy to remember, and simple to type out for the user.
- Spivak 4y agoit's not really about it being sexy, it's about it being able to be typed in manually on a mobile keyboard by humans. the url editing experience on mobile browsers is terrible. like trying to write an essay through a keyhole.
- bluetidepro 4y agoThat too, yup!
- prmoustache 4y agoTim Berners-Lee invented hyperlinks so that URLs can be shortened to a single word, character or even image while keeping them visible to the user if need to by hovering over it. People using these kind of links shorterner are people using bad tools and bad UIs. This is that usage that needs to be corrected, and not by inventing things even more stupid.
- InitialBP 4y agoYou can't put a hyperlink on a magazine, the tv, or the radio. There are definitely reasonable applications of shortened URLs that apply outside of the normal day-to-day web browsing and applications.
- pluc 4y agoI remember the short url craze - bitly alternatives were everywhere (even @ the G[1]!) and creating one was basically the Hello World of programming for a time. Real shame how it went from convenience tool (and largely coupled with microblogging character limit) to aggressive corporate tracking (though bitly was always a champion of the latter) https://developers.googleblog.com/2018/03/transitioning-google-url-shortener.html https://developers.googleblog.com/2018/03/transitioning-goog...
- bluetidepro 4y agoFYI you have some rogue script or something on the page that brings my pretty hefty windows 10 pc to a halt. It spikes my CPU to 100% and the page is in like 1FPS. I think it's your countdown thing for pricing. Something is def up with it, you may want to disable that temp.
- adoxyz 4y agoSame thing here. After scrolling about halfway through the page, fans went off and the whole site came to a crawl. Could also be the globe animation.
- steventey 4y agoAhh yes I believe it's the globe animation, it uses a very simple stripped down version of webgl & threejs (based on the lib: https://cobe.vercel.app/ https://cobe.vercel.app/) Gonna think about how I can optimize that further! Thanks for the headsup y'all!
- redweer 4y agoyou could render a mp4 or webm video, it wouldn't be as fancy but would just work
- ct0 4y agoSlows down my pretty basic laptop as well.
- whalesalad 4y agoHave you tried this? https://www.downloadmoreram.com/ https://www.downloadmoreram.com/
- Sohcahtoa82 4y agoYou know, if you put your paging file into your Google Drive, Dropbox, etc., you're effectively downloading more RAM.
- indonxmalon 4y ago
- memorable 4y agoA bit of a shameless plug, but I also created an open-source link shortener, using Python and Flask. Although not as polished and full-fledged as this one, it done its job pretty well, with basic click statistics and custom key URLs. https://github.com/HoangTuan110/flyurl https://github.com/HoangTuan110/flyurl
- HeckFeck 4y agoThe grandfather of all link shorteners: https://shorturl.com/ https://shorturl.com/ I had a .vze.com subdomain registered there in approx. 2006 and it still is live. Unfortunately, the target domain and website is long gone.
- memorable 4y agoThe site looks quite laggy on my phone, and moving around feels janky. Could it be the Javascript that caused this?
- steventey 4y agoHey! I believe it's the globe animation, it uses a very simple stripped down version of webgl & threejs (based on the lib: https://cobe.vercel.app/ https://cobe.vercel.app/) Gonna think about how I can optimize that further! Thanks for the headsup!
- Dolios 4y agoFYI, I'm on an absolute beast of a machine and my browser locked up while trying to view that page. When I mean beast, I mean beast.
- stjohnswarts 4y agoI think you should get rid of that stuff. I was compiling some el scripts in the background and surfing around just fine and got to your page and it starting taking a couple of seconds to respond to mouse clicks until closing the page, same for both Brave and Firefox (most recent versions on both) on windows 10. I'd give benefit of a doubt since you're doing a new service but most people wouldn't come back if that happened to their machine.
- memorable 4y agoSome necessary questions: - Does this use any blacklist to prevent URL shortener looping (i.e. using multiple URL shorteners on top of each other to bypass the checking), or preventing any potentially malicious sites? - Does this have rate limits? URL shorteners get abused quite regularly, so this should be necessary.
- steventey 4y agoVery good questions! I was actually thinking about that right before launching last night! I'm planning to blacklist certain problematic hostnames and not let folks add them. In terms of rate limits, it does have rate limits when it comes to collecting analytics (if you spam click a link >10 times in 10s it still redirects you but it stops recording clicks. I can't think of how URL looping could bypass checking – could you elaborate?
- LinuxBender 4y agoAssuming validation of their licensing one might be able to use the same .txt lists that the browser addon uBlock imports as a baseline, then have a way to add custom entries. To keep Google and Bing happy maybe check to see if they have an official list of bad domains as well.
- overshard 4y agoGood luck on your link shortener project! I made an open source link shortener many years ago and eventually threw in the towel and quit. The problem domain for link shorteners is one of anti-spam and abuse. Charging for it makes complete sense to try and weed this out but having any amount of "free" I found to be a hotbed of reports thrown against my hosting provider and registrar for supporting spam. I found myself getting quickly blacklisted everywhere since spammers love to use new shorteners for bypassing their own blacklists. I've not looked into the problem again in 10+ years since. If I did I would 100% skip the free plan.
- foxbee 4y agoGreat website. I really like the globe and overall theme - reminds me of Vercel. One small note - the github stars image made me think you had 0 stars. Not a big deal, but you might want to update it. Great work
- foxbee 4y agoThe UI of the product is nice too - really feels like Vercel which is a good thing. It would be good if you were able to build UTM tags in the product, and pull analytics on them - apologies if this already possible.
- steventey 4y agoThat's exactly the next thing on my roadmap! Thanks for the suggestion!
- steventey 4y agoOh my word! Good catch lol I'm not sure how that broke, will fix now! And thanks a lot for the kind words!
- gnicholas 4y agoI tried using a bitly alternative but found that when I sent them to users via email the links were flagged by gmail as being dangerous. There were no problems when I sent bitly links, or the plain links. I'm hesitant to try another alternative because I wouldn't want to get set up in a new system, only to have these problems crop up again.
- steventey 4y agoVery good point, I'm going to try and add some abuse prevention measures to make sure the domain doesn't get blacklisted! In the meantime, you can also use your own custom domain for maximum control: https://twitter.com/steventey/status/1572958205814214657 https://twitter.com/steventey/status/1572958205814214657
- stjohnswarts 4y agoI assume thats because bitly has excellent blocking for known malware sites and techniques (rate limiting/etc) since they've been around for so long.
- jonas-w 4y agoGenuine question. Why would people pay for the pro version if they could just host it for themselves? Does the pro version have some proprietary stuff which would have advantages to the selfhosted version?
- vinaypai 4y agoI can easily envision a non-technical person spending a few bucks for this because they don't know how to set things up without help. I don't see that working at $99/month though. It's WAY more than most bit.ly plans for a vastly more limited product.
- steventey 4y agoThat's a great point, thanks for mentioning that! I'm gonna do some pricing research over the next couple of months to see what the optimal pricing is for a tool like this! :)
- dspillett 4y agoThe usual use case for paying for something you could self-host, is that you don't have to self-host and therefore manage it. Someone else deals with installation, updates, and ongoing availability. For something like this there is perhaps extra factors like someone else worrying about abuse by malicious users and the resulting risk of being black-listed by spam filters.
- sosborn 4y agoAt my work, getting approval to pay for this would take about 5 minutes. On the other hand, if I had to provision a server to self-host, I might be lucky to have this done in the next six weeks, depending on how IT is feeling when I ask.
- throitallaway 4y agoHere we'd also have to go though a vendor review (security, legal, etc.)
- kls0e 4y agoHow does this compare to YOURLS [0]? btw, I like link shorteners for their millenial quirkiness. kickme.to/the2000s [0] https://yourls.org/ https://yourls.org/
- dijit 4y agoHeh, I did the opposite recently after reading "Software Engineering at Google" and I discovered that even though it would be very easy to make: there is no equivalent to the `go/` permanent "friendly" URL shortener. It can be backed by a TOML file for hardcoding URLS or a database for making it easy to add new ones (which I think is the Google way). If I did a stupid; or a better version already exists: let me know. https://git.drk.sc/dijit/redirector-rs https://git.drk.sc/dijit/redirector-rs https://github.com/dijit/redirector-rs https://github.com/dijit/redirector-rs
- steventey 4y agoTrue! But a link shortener SaaS is more than just redirects – it also needs data visualization to help marketing teams understand the performance of their links, which is half of the value prop imho! That being said, absolutely love your spin on the go/ links – I learned about it from my friend who works at GitHub and it's kinda blown my mind ever since :)
- jedberg 4y agoI'm not sure how being open source helps here. How do we know the code that is running on the service is the same as the open source code?
- rabuse 4y agoI mean, you could say that about any open source service. The best way to see if it works like the service, is to just compile it and run it yourself...
- steventey 4y agoIt's basically an effort to promote code transparency + user privacy, and in general it's just super fun building in public! :)
- miked85 4y agoThe last thing the Internet needs is more link shorteners.
- TimLeland 4y agoI'm the creator of https://T.LY https://T.LY URL Shortener and am always interested when I see new short link services. My biggest piece of advice is to figure out a way to detect malicious URLs before your service is completely shut down. A month after starting T.LY, my servers were disabled by my hosting company without warning. Since then, I've worked on systems and tools to prevent malicious short links and make the service more reliable. Most comments I see here are questioning why we still need URL shorteners. Print, media, SMS, and analytics are just a few reasons. I wrote some additional info on my blog: https://timleland.com/are-url-shorteners-useful-today/ https://timleland.com/are-url-shorteners-useful-today/ Another interesting thought is when you create a TinyURL, it's 20 characters long, and Bitly links are 14 characters long. These services cannot create short links anymore. As a URL shortener grows, the number of actual short links diminishes. Currently, T.LY has over 10 million short links, which means plenty of four and five-character short URLs are available. Two character URLs 3,844 (62^2) unique combinations Three character URLs 238,328 (62^3) unique combinations Four character URLs 14,776,336 (62^4) unique combinations Five character URLs 916,132,832 (62^5) unique combinations Six character URLs 56,800,235,584 (62^6) unique combinations Seven character URLs 3,521,614,606,208 (62^7) unique combinations Eight character URLs 218,340,105,584,896 (62^8) unique combinations
- lioeters 4y agoJust curious, can a short link be a single emoji as the URL (after domain)? If so, does it technically take up 4 characters? And (if you don't mind answering) how much does such a short domain like t.ly cost?
- jraph 4y agoIt is possible, but your users will need to type emojis (which can be hard or impossible on some devices), or you'll need to urlencode it in href attributes and it will actually take encodeURIComponent("").length = 12 characters (imagine a simple emoji between the quotes). It will also require bigger QRCodes than alphanumeric characters. It might display incorrectly in address bars.
- 4y ago
- slang800 4y agoYou should add a way to export all the URLs on the platform in a format that matches the URLTeam (https://wiki.archiveteam.org/index.php/URLTeam https://wiki.archiveteam.org/index.php/URLTeam) releases. That way, when you shut down your service, we can figure out what some of these short links went to.
- lioeters 4y ago> when you shut down That's a reasonable assumption, since the service is not likely to be sustainable financially.
- klelatti 4y agoWhy shouldn't it be sustainable? Seems like the sort of service where a freemium AGPL open source model might work quite well.
- steventey 4y agoAgreed – the plan is to keep this running as long as possible, and the freemium AGPL model is a great way to get there in a sustainable pace! :)
- anderspitman 4y agoNote that for many use cases, you can host your own URL shortener for free on GitHub pages (or Netlify, etc) by creating static index.html pages containing HTML redirects[0]. If you buy your own short domain, you can even port it between different providers if necessary. [0]: https://apitman.com/18/#html-redirects https://apitman.com/18/#html-redirects
- jeffreygoesto 4y agoI read "Billy alternative" and waited for some cool Ikea hack. Bummer.
- steventey 4y agolol that would've been amazing haha
- trevcanhuman 4y agoNice project, although I'd definitely not use it. The website seems too bloated and as others have said uses too much ram. For personal use I just curl one of these URLs from my linux machine: https://wiki.archlinux.org/title/List_of_applications#Pastebin_services https://wiki.archlinux.org/title/List_of_applications#Pasteb...
- steventey 4y agoApologies for the performance issues! I just merged a PR that should mitigate this: https://github.com/steven-tey/dub/pull/13 https://github.com/steven-tey/dub/pull/13 Can you check again and let me know if the performance issue is still bad?
- jiffygist 4y agoApplication error: a client-side exception has occurred (see the browser console for more information). I'm using Bromite on Android
- aliljet 4y agoI ran a variation of something like this myself for years. Eventually, the site was routinely being used for spam-style (e.g., a link to some illegal data, or some advertisement to embed somewhere, etc.) links. And when I took the site down, my users asked me for help to transition away from this service that they were uniquely relying on. It was a mess. See goo.gl. I wonder how you prevent your service from being used inappropriately and how you handle the eventual costs
- steventey 4y agoVery good point re: goo.gl My plan here is to lean into the custom domains & self-hosted aspect – where enterprises and businesses would be able to get set up with a custom domain link shortener super easily. Individual short links are definitely not sustainable in the long run, I might set a rule where randomly-generated links > 30 days get deleted, to save it you'll either need to make an account (to prevent spam) or set up your own domain.
- KronisLV 4y agoLooks like a visually pleasant site to browse, however it appears that there is some lag on Firefox (on the desktop), at least for me. As far as link shorteners go, I actually host my own containerized instance of YOURLS: https://yourls.org/ https://yourls.org/ It's fairly boring and not really pretty, but it seems to work okay for me. Actually, as far as self-hosting goes, there's quite a few options out there: https://github.com/awesome-selfhosted/awesome-selfhosted#url-shorteners https://github.com/awesome-selfhosted/awesome-selfhosted#url... Of course, one can also find some free services hosted by others.
- kerv 4y ago> however it appears that there is some lag on Firefox (on the desktop) I also had noticeable lag using Chrome (on desktop)
- stjohnswarts 4y agofirefox and brave both choked on it for me (while a bunch of el scripts are building in the background). that page killed my GUI responsiveness lol which was unencumbered before I went there (aka windows was doing fine with compiling in the background and letting me browse the web)
- steventey 4y agoThanks for the headsup re: the lag – there's some performance issues with the Globe animation that I'm trying to fix right now, sorry about that!
- sccxy 4y agoJust remove it. Your site is good without the globe. Application error: a client-side exception has occurred (see the browser console for more information).
- steventey 4y agoJust merged a PR that should mitigate this: https://github.com/steven-tey/dub/pull/13 https://github.com/steven-tey/dub/pull/13 Can y'all check again and let me know if the performance issue is still bad? Feel free to reply here or send me an email at steven[at]dub.sh
- jawadch93 4y ago[dead]
- statico 4y agoI did something similar with https://statico.link https://statico.link when I couldn't find a cheap, free and easy service to do this. It started as a simple nginx URL map since I was already running nginx (https://gist.github.com/statico/14fa84d7e79722031d5e49694191ba1d https://gist.github.com/statico/14fa84d7e79722031d5e49694191...) but is now a tiny containerized app because friends requested an index page. The requirement is that all links need to be named (i.e. no random hashes).
- xmonkee 4y agoCan I ask what you used to make that landing page? I've seen a lot of pages use that template lately and it's killing me not knowing
- steventey 4y agoIt's not a template but it uses Tailwind (tailwindcss.com)! Here's the full list of design inspirations for the site: https://twitter.com/steventey/status/1572958213250629633 https://twitter.com/steventey/status/1572958213250629633
- Komodai 4y agoYour site is completely killing my browser.
- orangepurple 4y agoReminder that there are also great tools designed to do the opposite. https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/ https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... google.com becomes https://aaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.com/aàÃaAæâÄæäÁÃÅæâÀÁÁÆÂÁAâÂÂàÄàâáÄÃáÆÁàaÆÃàåáâÄÄÃâãåâæáÀÂÅAÂãaåäãääÅÅAäÆÄa忯ãaÂæÅÀàãÅÆÂÅÁæÅAàÄÁÃÄäÂÃáàÃÀaAÃAåæÅãâÂÅÃÅÄÂæÆÅÃÀäáâÃÁäÆÃÂÅÃâÄÁÀåæäãÆääâAàaåAÃæâÅäÁÄÆÃAÆáÃÂ?åAæãæãæaæââÁáÆáÆåæåÆåÆåæåÃåäáÅåâåÆåÄ https://aaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa... shadyurl.com was fun while it lasted. Tagline: Don’t just shorten your Shady URL, make it suspicious and frightening.
- steventey 4y agoLove these lol, really gave me a good laugh when I saw them in the past
- password4321 4y agoAnother chance to warn about: Shorten URLs using invisible spaces https://github.com/zws-im/zws https://github.com/zws-im/zws
- steventey 4y agoWhoa, had no idea this was possible. Pretty cool!
- shawnrmclean 4y agoWhat happens on the free plan and the 1001'th person clicks the link?
- steventey 4y agoThe link still works, and the link still gets tracked in redis, you just won't be able to see the stats for the link until you upgrade. It's a similar model to Plausible.io, which I think is really fair! Let me know what you think! :)
- midspectrum 4y agoearlier there was an option to add "+" at the end of any bit.ly link and you can see the stats of any shortened URL. Is that something you've given a thought?
- steventey 4y agoOh interesting! You can actually do that right now with https://dub.sh/stats/<YOUR_SHORTLINK_SLUG> https://dub.sh/stats/<YOUR_SHORTLINK_SLUG> E.g. https://dub.sh/stats/github https://dub.sh/stats/github But I like this idea, might just add it to Dub... ;)
- FlashBlaze 4y agoStill need to fix some bugs, but I made an URL expander using Preact and Cloudflare Workers: https://expand.flashblaze.xyz/ https://expand.flashblaze.xyz/
- jensenbox 4y agoRedis as a primary database gives me chills.
- bawolff 4y agoNot to be negative, but aren't there like a billion open source url shorteners at this point?
- workingpatrick 4y agonice try nsa
- somishere 4y agoI built a very, very basic one of these a month ago to shorten a couple of unruly domains I had. Supports static and dynamic endpoints that you define. https://thesom.au/gh/shorturl https://thesom.au/gh/shorturl Intended to self host for free/minimal cost on CloudFlare, thus comes with built in analytics, BYO domain, etc.
- steventey 4y agoLove this, thanks for sharing!! Did you get to building out the analytics dashboard? Would love to check it out! :D
- somishere 4y agoNo dashboard, or web interface even - the idea is that you just use CF's worker analytics for usage stats. There's no storage / db sitting behind it, just a single file to deploy as a worker. Logical next step would be to hook it into KV and include a basic auth/admin API for editing routes and retrieving stats. But even that would add a bucket load of complexity to what is essentially 20-30 lines of obtuse logic currently. Definitely no plans to deploy as a service with custom domains and enterprise offerings :)
- nipperkinfeet 4y agoIs your website cryptojacking? It blew up my GPU.
- steventey 4y agoIt was because of the globe animation, which is a stripped down version of Three.js + webGL. I just merged a PR that should mitigate this: https://github.com/steven-tey/dub/pull/13 https://github.com/steven-tey/dub/pull/13 Can you check again and let me know if the performance issue is still bad?
- zicxor 4y agoVery laggy - i am getting 10 FPS in your website. You should consider optimizing. Good project, congrats!
- fabform 4y ago
- iamthejuan 4y agoI had an account before in Bitly, the username is "username", one day, they just deleted my account for no reason. I never used their service again.
- vixalien 4y agothe globe on the homepage needs some lube. scrolling it on mobile takes some while