[HN Gopher] Show HN: I made an open-source Bitly alternative
       ___________________________________________________________________
        
       Show HN: I made an open-source Bitly alternative
        
       Author : steventey
       Score  : 192 points
       Date   : 2022-09-22 14:39 UTC (8 hours ago)
        
 (HTM) web link (dub.sh)
 (TXT) w3m dump (dub.sh)
        
       | memorable wrote:
       | A 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
        
       | overshard wrote:
       | Good 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.
        
       | shawnrmclean wrote:
       | What happens on the free plan and the 1001'th person clicks the
       | link?
        
         | steventey wrote:
         | The 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! :)
        
       | HeckFeck wrote:
       | The grandfather of all link shorteners: 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.
        
       | midspectrum wrote:
       | earlier 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 wrote:
         | Oh interesting! You can actually do that right now with
         | https://dub.sh/stats/<YOUR_SHORTLINK_SLUG>
         | 
         | E.g. https://dub.sh/stats/github
         | 
         | But I like this idea, might just add it to Dub... ;)
        
       | aliljet wrote:
       | I 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 wrote:
         | Very 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.
        
       | memorable wrote:
       | The site looks quite laggy on my phone, and moving around feels
       | janky. Could it be the Javascript that caused this?
        
         | steventey wrote:
         | Hey! 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/)
         | 
         | Gonna think about how I can optimize that further! Thanks for
         | the headsup!
        
           | stjohnswarts wrote:
           | I 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.
        
           | Dolios wrote:
           | FYI, 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.
        
             | steventey wrote:
             | Oh nooo :( what's the specs of your computer? I'm gonna try
             | and optimize this further tonight!
        
       | mnemnc wrote:
       | This 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 wrote:
         | No plans yet, but you can easily clone this repo and deploy
         | your own version on platforms like Vercel.com, no docker
         | containers required! :)
        
       | medv wrote:
       | Here's mine: https://xn--gda.at
        
         | medv wrote:
         | Apparently HN replaces i.at to xn-
        
           | briandoesdev wrote:
           | Didn't think they'd handle punycode like that.
        
           | dicknuckle wrote:
           | xn-- for me
        
         | steventey wrote:
         | Funny 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#L12...
        
       | nipperkinfeet wrote:
       | Is your website cryptojacking? It blew up my GPU.
        
         | steventey wrote:
         | It 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 Can
         | you check again and let me know if the performance issue is
         | still bad?
        
       | statico wrote:
       | I did something similar with 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/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).
        
       | trevcanhuman wrote:
       | Nice 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#Pasteb...
        
         | steventey wrote:
         | Apologies for the performance issues! I just merged a PR that
         | should mitigate this: https://github.com/steven-tey/dub/pull/13
         | 
         | Can you check again and let me know if the performance issue is
         | still bad?
        
       | somishere wrote:
       | I 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
       | 
       | Intended to self host for free/minimal cost on CloudFlare, thus
       | comes with built in analytics, BYO domain, etc.
        
         | steventey wrote:
         | Love this, thanks for sharing!! Did you get to building out the
         | analytics dashboard? Would love to check it out! :D
        
           | somishere wrote:
           | No 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 add custom domains :)
        
       | jackson1442 wrote:
       | Do 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 wrote:
         | Yeah 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 wrote:
           | > 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.
        
       | foxbee wrote:
       | Great 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
        
         | steventey wrote:
         | Oh my word! Good catch lol I'm not sure how that broke, will
         | fix now!
         | 
         | And thanks a lot for the kind words!
        
         | foxbee wrote:
         | The 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 wrote:
           | That's exactly the next thing on my roadmap! Thanks for the
           | suggestion!
        
       | robin_reala wrote:
       | I really hate link shorteners, because they inevitably die and
       | leave a spray of broken links over the web. What's wrong with
       | normal URLs?
        
         | xtracto wrote:
         | I have wanted to implement a link shortener with a couple of
         | monetization ideas to avoid that:
         | 
         | * Allow you to "buy" transparent clicks for your URL (e.g. 1
         | cent per "transparent" click)
         | 
         | * Implement "ad gateway" like what adf.ly does for non-
         | transparent URLs
         | 
         | * Give you X small amount of "transparent" clicks for free
         | 
         | * Use something like IPFS or (gasp) Ethereum blockchain for
         | storing the data... allow you to keep your URLs alive by paying
         | for them (this last one is not that clear)
         | 
         | * [Don't kill me] At some point (back when it had started) I
         | though of putting a WASM miner in a frame when visiting a page.
         | 
         | My main problem is that I have not been able to get a good
         | domain name.
        
         | efficax wrote:
         | how else would you embed tracking params into spam links sent
         | over sms, riddle me that
        
           | LinuxBender wrote:
           | Query strings after an image URL are the most common I have
           | seen.                   https://some.tld/obvious-
           | tracking/some-transparent.png?someUniqueCode
        
             | sosborn wrote:
             | But now you've burned about 40% of your character limit.
        
               | LinuxBender wrote:
               | Fair enough. I hope that should I ever get a smart phone
               | that there are filters to make all SMS text only. My
               | current flip-phone just renders html as text and binary
               | images as garbled junk.
        
               | sosborn wrote:
               | > I'm OK with this.
               | 
               | I mean, on a personal level sure, but if you need to get
               | out an SMS with a link and a coherent message, you want
               | all the characters you can get.
        
               | LinuxBender wrote:
               | In that case I would go with a tiny SMS specific domain
               | for the company and a tiny query string.
               | https://my.tld/r?B33F Two hex values should allow for a
               | large number of redirects for a single company. Or even
               | one hex code and use a different letter /a?00 /a?FF /b?AF
               | etc... 36x255
               | 
               | I would give the marketing/sales team a way to update the
               | letter/HEX map as a plain text file.
        
         | ddevault wrote:
         | Agreed. Please do not use this software, nor link shorteners
         | generally.
        
         | forgotpwd16 wrote:
         | In past they took much space in comments and messages. Now most
         | sites have gotten smarter and automatically shorten a long URL
         | when presenting it. For the first part, depending on site, a
         | deterministic shortener could be possible. For example
         | "example.com/blog/2022/09/22/first-article-of-the-day.html" can
         | be "example.com/s/b22092201". Remember read someone utilizing
         | something like this but cannot find the article.
        
         | anderspitman wrote:
         | Short URLs are nice for some things. QR codes for example work
         | better the shorter a URL is.
         | 
         | Nothing's wrong with normal URLs. Every post on my website can
         | be reached by a single decimal number appended to the end of
         | the domain.
         | 
         | But this requires every website on the internet to care about
         | having URLs of reasonable length. URL shorteners allow a third
         | party to put a bandaid over the problem.
        
         | wizofaus wrote:
         | When a URL is generated and contains some long cryptic un-
         | memorizable code they're pretty handy (but only if you can
         | specify the path name yourself, which is how I use tinyurl)
        
         | bluetidepro wrote:
         | >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.
        
           | MisterSandman wrote:
           | I feel like custom URLs are better than random bit.ly. I can
           | create a link like `company.com/summer23promo` that is easier
           | to remember than `bit.ly/gsjsun618n`
           | 
           | I think the paid version let's you do custom URLs but that is
           | just a worse version of doing it yourself since a typo can
           | lead to a completely random website.
        
           | robin_reala wrote:
           | Right, but your domain name is part of your marketing effort.
           | And you don't need to resort to a short URL service to get a
           | branded URL. If you listen to any sponsored podcasts they
           | have the job of reading out a sponsorship URL, and inevitably
           | it's something like {sponsoringCompany}.com/{podcastName},
           | which is totally understandable to people.
        
             | 411111111111111 wrote:
             | It is maybe understandable but also too long for lots of
             | content.
             | 
             | You want it to be as short and memorable as possible for
             | anything which has limited "screen" time. Which is
             | basically everything, i.e. Radio broadcasts, video
             | streams/adverts, Billboards you drive by, advertisements on
             | websites etc.
        
           | Spivak wrote:
           | it'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 wrote:
             | That too, yup!
        
           | prmoustache wrote:
           | Tim 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 wrote:
             | You 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.
        
               | indymike wrote:
               | Bitly exists because of Twitter and SMS character limits.
        
               | extra88 wrote:
               | I don't know how long this has been true but all links in
               | tweets are replaced with Twitter's own link-shortener
               | links (t.co). No matter how short your link is, in a
               | tweet it will consume 23 characters.
               | 
               | https://help.twitter.com/en/using-twitter/how-to-tweet-a-
               | lin...
        
               | tenacious_tuna wrote:
               | I run into similar problems in a corporate context. Being
               | able to quickly tell someone "the provisioning portal is
               | at corp.short/provision" is easily 10x more useful than
               | "go look in the wiki for the link"
        
               | reilly3000 wrote:
               | See also: golinks
        
               | prmoustache wrote:
               | qrcodes are superior for most printed usage.
               | 
               | It never occured to me to type an url from a radio or TV
               | message and I've never heard anyone spelling an url from
               | a url shortener. All TV/radio broadcasters will rather
               | tell you check for more information in "name of the show"
               | on "domain of the TV/radio channel" or their social media
               | feed. They all have a web presence anyway.
        
               | sosborn wrote:
               | > qrcodes are superior for most printed usage.
               | 
               | Agreed
               | 
               | >It never occurred to me to type an url from a radio or
               | TV message and I've never heard anyone spelling an url
               | from a url shortener.
               | 
               | It happens. How do I know? Every time I've included a url
               | (shortened or not) in a radio/tv ad, I've gotten verified
               | traffic.
               | 
               | > All TV/radio broadcasters will rather tell you check
               | for more information in "name of the show" on "domain of
               | the TV/radio channel" or their social media feed.
               | 
               | This is a best practice for sure, but we all answer to
               | someone, and that someone might not care.
        
               | Volundr wrote:
               | > qrcodes are superior for most printed usage
               | 
               | Disagree. I can't scan or type a QR code into my
               | computer.
        
               | prmoustache wrote:
               | Usuallt you don't deal with printed code when you are in
               | front of a computer and even then it is easy to scan the
               | code with your phone and paste the link on your computer.
        
               | Volundr wrote:
               | I don't? I do most of my reading at home where I have
               | multiple computers in easy reach. I'm also not sure how
               | I'm "easily" copy/pasting between my phone/computer. Is
               | this an iOS/OS X thing? Not everyone is in that eco-
               | system.
        
               | steventey wrote:
               | Just wanted to chime in and say that QR Codes are next on
               | the roadmap! Would be fun to learn how to build those
        
               | stjohnswarts wrote:
               | how are they any better than url shorteners? Now I have
               | to download a qr code reader, screen grab it, convert it
               | with said app, and that opens in a browser
        
               | prmoustache wrote:
               | apart from the download that happens once, it is just a
               | case of pointing your camera to the code and the browser
               | open by the touching the screen once. Quicker than typing
               | a shortened url.
        
               | blowski wrote:
               | Aren't QR code readers built into Android and iOS?
        
               | solardev wrote:
               | Depends on your OS, manufacturer, and version. In
               | Android, it depends on your camera app (and version).
               | Later Google Camera versions have that, for example, but
               | earlier ones (as of a few years ago) did not.
        
               | Semaphor wrote:
               | I agree, we sell PDFs with the ability to be printed, all
               | links are short links (on our own domain, though) so they
               | aren't lost/inaccessible when printed.
        
             | bluetidepro wrote:
             | I think you underestimate how much separation there
             | sometimes is on large teams with the people who run/build
             | the website, vs the marketers who are moving fast. I've
             | seen terrible devs who will claim it takes DAYS to add a
             | simple redirect of dog.com/X to your long marketing url
             | (cutting out services like this), but the marketing team
             | can't wait that long so services like this are much more
             | async in many contexts, too.
        
               | solardev wrote:
               | 100% this... I was our web dev working with marketing,
               | and before I got there, short URLs/marketing links had to
               | be manually created as new pages in Drupal sometimes, in
               | a 301 redirect dashboard other times (what the hell),
               | which meant submitting a ticket, waiting for it to get
               | prioritized, etc., then making sure there were no
               | conflicts anywhere.
               | 
               | Switched it out with a cheap commercial short URL system
               | with its own domain, and the marketers could login
               | anytime and make their own URLs, see all the analytics,
               | edit the destinations, etc.
               | 
               | Everyone was much happier after that. It did indeed cut
               | the wait from days to seconds, and plus they had real-
               | time usage data after that.
        
             | [deleted]
        
             | EGreg wrote:
             | Actually, link shorteners are just a symptom of the
             | problem.
             | 
             | The problem is the DNS system itself. It is the reason that
             | your email address gets spammed, and the reason that you
             | can DDOS websites, etc.
             | 
             | DNS is a glorified search engine, and it is only really
             | used for root urls like mydomain.tld . It's pretty much
             | only good in two contexts:
             | 
             | 1) for when people dictate a specific domain name verbally
             | to someone, and even then, spelling errors can occur.
             | 
             | 2) advertising a URL somewhere to a landing site. But you
             | can just use a QR code that people can scan, or a link in a
             | webpage.
             | 
             | Everything else may as well be at non-human-readable domain
             | names, in which case you can even use distributed hash
             | tables instead of DNS. Perhaps one day browsers will allow
             | plugins realize their own schemas, such as
             | ipfs://hjkldfjhsdfkjgsdhfgsdf and the plugin would do the
             | routing instead of DNS. Is that currently possible with
             | standard browser extensions?
        
               | blowski wrote:
               | I'm pretty sure my email gets spammed because bad actors
               | exist in the world. I'm sceptical any technical solution
               | will protect against that.
        
               | EGreg wrote:
               | It takes both. If people couldn't send a message to your
               | email just by knowing it, then you wouldn't get SPAM.
               | 
               | Instead, you could be giving out capabilities, to send
               | you email. And if one of them was abused, you'd simply
               | turn it off, and only accounts who used it in the past
               | could continue to send. New ones wouldn't be.
        
         | dewey wrote:
         | > What's wrong with normal URLs?
         | 
         | Nothing, but how would you then track users and redirect
         | through 3 nested services to attribute purchases? ;)
        
         | KronisLV wrote:
         | > What's wrong with normal URLs?
         | 
         | I've seen some random blogging software break when you embed
         | certain kinds of links into articles, for example, ones that
         | have query strings (?key=value), where the question mark gets
         | interpreted as something else by the software and thus the link
         | gets cut off and no longer works.
         | 
         | In cases like that, it makes sense (because you literally don't
         | have a choice, unless you want to migrate to something else).
         | 
         | Also some might enjoy the consistency of short links, instead
         | of having a URL that's really long. That is also pretty nice
         | for putting the URL on a poster, flier, or sending it to
         | someone.
         | 
         | Some also just don't care about the implications of the link
         | going down in the future.
        
         | beauHD wrote:
         | There's a project[0] designed to archive various URL shorteners
         | to combat the link-rot problem. It's ran by ArchiveTeam which
         | is a bunch of preservationists who are hell-bent on preserving
         | parts of the web that otherwise would go into the dustbin of
         | history.
         | 
         | [0] https://wiki.archiveteam.org/index.php?title=URLTeam
         | 
         | [0] https://tracker.archiveteam.org:1338/status
        
           | bjord wrote:
           | yeah, this is cool, but in the future, wouldn't it be better
           | to just skip the link shorteners?
        
           | carvking wrote:
           | Maybe these fine people should run a url shortener service.
        
         | memorable wrote:
         | Not to mention the fact that they can be abused to redirect
         | into malicious sites, but I think that is pretty obvious at
         | this point.
        
           | orliesaurus wrote:
           | Agreed I think on bitly at least you can use some character
           | after the URL - I think its bit.ly/somethingsomething+ (the
           | plus) - and you get a bitly page that shows you where the URL
           | is supposed to land.
           | 
           | I think tinyurl had a similar mechanism.
        
             | memorable wrote:
             | TinyURL has a feature called preview mode, which allows you
             | to automatically preview any URL before getting redirected
             | without using the extra +. I think it's a nice feature.
        
               | koolba wrote:
               | IIRC, tinyurl also rewrites URLs to some commerce sites
               | to include their affiliate token.
        
         | steventey wrote:
         | Hey! Creator of Dub here! Appreciate the sentiment, also great
         | point in the replies about link shorteners leading to spam.
         | 
         | My plan with Dub is to keep this running at a sustainable pace
         | for as long as possible, and I believe it's possible for a few
         | reasons:
         | 
         | - Operating costs for Dub are quite low at the moment, thanks
         | to Edge Functions (https://vercel.com/edge) + Redis.
         | 
         | - I'm leaning into the custom domains & self-hosted aspect with
         | the freemium model - where enterprises and businesses would be
         | able to get set up with a custom domain link shortener super
         | easily.
         | 
         | - Agree that 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.
        
         | boredemployee wrote:
         | An use case:
         | 
         | I work daily with short links, because we need to pass
         | parameters in URL and, depending on the amount of parameters
         | you use in your URL, it gets bigger quickly.
         | 
         | Then you have many stakeholders, with no IT background, using
         | those links and if for some reason they use ctrl+c missing some
         | part of that big URL, the access will be broken and then they
         | will complain its not working.
         | 
         | Short links are better to avoid that problem.
        
           | atahanacar wrote:
           | That's why you have your own link shorteners. There is no
           | reason to use some third party shortener that may or may not
           | be alive the next year.
        
             | boredemployee wrote:
             | I actually use a third party, because I'm not a dev and
             | have no idea on how to do one myself.
        
       | TimLeland wrote:
       | I'm the creator of 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/
       | 
       | 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
        
         | steventey wrote:
         | Hey Tim! Thanks a lot for sharing your experience with T.LY!
         | I'm definitely going to implement some abuse prevention
         | measures over the next few days. My first instinct is to
         | prevent folks from pointing shortlinks to certain malicious
         | sites - do you think that'll be enough? Or are there other
         | abuse vectors?
         | 
         | Also, very interesting note regarding the hash combinations!
         | The main focus of Dub is probably going to be for folks to add
         | their own domains - but this is something that I'll keep in
         | mind as well!
        
         | lioeters wrote:
         | Just 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 wrote:
           | It 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.
        
             | steventey wrote:
             | Yeah, someone actually created an issue for this on the
             | repo: https://github.com/steven-tey/dub/issues/8
             | 
             | I'm planning to not allow emojis simply because of the
             | accessibility challenges that it presents to users :')
             | 
             | Emoji domains though, on the other hand, are really cool
             | and more than welcome to be added :)
        
       | jiffygist wrote:
       | Application error: a client-side exception has occurred (see the
       | browser console for more information).
       | 
       | I'm using Bromite on Android
        
       | kls0e wrote:
       | How does this compare to YOURLS [0]? btw, I like link shorteners
       | for their millenial quirkiness. kickme.to/the2000s
       | 
       | [0] https://yourls.org/
        
       | pluc wrote:
       | I 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-goog...
        
       | slang800 wrote:
       | You 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) releases.
       | 
       | That way, when you shut down your service, we can figure out what
       | some of these short links went to.
        
         | toomuchtodo wrote:
         | As part of url derive process, you could kick off a process to
         | archive the redirect with the Internet Archive. When you turn
         | the service down, no further action is required. It can die at
         | anytime and no one is worse off.
        
         | lioeters wrote:
         | > when you shut down
         | 
         | That's a reasonable assumption, since the service is not likely
         | to be sustainable financially.
        
           | klelatti wrote:
           | Why shouldn't it be sustainable? Seems like the sort of
           | service where a freemium AGPL open source model might work
           | quite well.
        
             | Nextgrid wrote:
             | Hosting costs money regardless of whether the underlying
             | codebase is open source, but why would anyone pay for a URL
             | shortener? Maybe those things had a use a decade ago but I
             | don't see a use for them nowadays and definitely not enough
             | to pay for one.
        
               | ransom1538 wrote:
               | "but why would anyone pay for a URL shortener?"
               | 
               | If you are sending automated sms, to around phone carrier
               | blocking people use bit.ly etc. A new domain would take a
               | lot of testing.
        
             | steventey wrote:
             | Agreed - 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! :)
        
               | lioeters wrote:
               | Sorry for the pessimistic quip.
               | 
               | I love that it's open source, the site design is
               | beautiful, and the service looks well made. Good luck!
        
               | steventey wrote:
               | Appreciate the kind words! :)
        
       | KronisLV wrote:
       | Looks 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/
       | 
       | 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...
       | 
       | Of course, one can also find some free services hosted by others.
        
         | steventey wrote:
         | Thanks 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 wrote:
           | Just 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 wrote:
             | Just merged a PR that should mitigate this:
             | 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
        
               | sccxy wrote:
               | It's better now.
               | 
               | I can scroll to bottom without crashing, but it is still
               | high cpu usage and fans start spinning.
        
               | steventey wrote:
               | Thanks for letting me know! I'm gonna keep digging into
               | optimization strategies! :)
        
         | kerv wrote:
         | > however it appears that there is some lag on Firefox (on the
         | desktop)
         | 
         | I also had noticeable lag using Chrome (on desktop)
        
           | stjohnswarts wrote:
           | firefox 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)
        
       | FlashBlaze wrote:
       | Still need to fix some bugs, but I made an URL expander using
       | Preact and Cloudflare Workers: https://expand.flashblaze.xyz/
        
       | memorable wrote:
       | Some 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 wrote:
         | Very 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 wrote:
           | Assuming 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.
        
       | bawolff wrote:
       | Not to be negative, but aren't there like a billion open source
       | url shorteners at this point?
        
       | bluetidepro wrote:
       | FYI 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 wrote:
         | Same 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 wrote:
           | Ahh 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/)
           | 
           | Gonna think about how I can optimize that further! Thanks for
           | the headsup y'all!
        
             | redweer wrote:
             | you could render a mp4 or webm video, it wouldn't be as
             | fancy but would just work
        
         | ct0 wrote:
         | Slows down my pretty basic laptop as well.
        
           | whalesalad wrote:
           | Have you tried this? https://www.downloadmoreram.com/
        
             | Sohcahtoa82 wrote:
             | You know, if you put your paging file into your Google
             | Drive, Dropbox, etc., you're effectively downloading more
             | RAM.
        
               | Sohcahtoa82 wrote:
               | I wanted to add to this, but the edit window has ended
               | so...
               | 
               | To go even further, if you have gigabit internet and the
               | data center that hosts your drive is in the same city as
               | you, then putting your swap in cloud storage could
               | potentially be faster than storing it on a hard drive!
               | 
               | Obviously, this is making a lot of assumptions, like your
               | ISP doesn't do any silly routing (I'm in Portland, and
               | for a while a couple years ago, my ISP routed all my
               | traffic through Seattle), assumes the cloud storage
               | provider is using solid state storage, and all the code
               | involved in retrieving it doesn't add more than a couple
               | ms of latency.
        
               | gpm wrote:
               | Heh, people have done it with NAS apparently
               | https://superuser.com/a/861203
        
         | FlingPoo wrote:
         | Same here too.... 8% CPU and 95-100% GPU usage (Firefox, latest
         | version/patch)
        
         | brycewray wrote:
         | Next.js strikes again. :-)
        
           | elforce002 wrote:
           | FTW!
        
         | owenpalmer wrote:
         | Maybe it's the 3D sphere
        
         | steventey wrote:
         | Hey everyone! My good friend & colleague Shu just pushed a PR
         | that should mitigate this: 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
         | 
         | FYI Shu (https://github.com/shuding) is the creator of the
         | globe library that I'm using on the home page:
         | https://cobe.vercel.app, it's really good!
        
         | stjohnswarts wrote:
         | I was doing "native compile" of several hundred el scripts for
         | emacs and my computer was fine, clicked on that page and
         | everything started taking a couple seconds to click afterwards
         | lol. Definitely something up with the javascript on there.
        
         | sosborn wrote:
         | Chiming in - brought down my Chrome tab on a Ryzen 3600x. All
         | for a page to display pricing.
         | 
         | I don't get it.
        
         | hobo_mark wrote:
         | No joke! Typing this from my phone as it somehow froze the
         | browser on my workstation.
        
         | punkspider wrote:
         | It spikes my GPU to 100% as soon as I open the page.
        
           | [deleted]
        
         | itslennysfault wrote:
         | I think it literally killed my M1 MBP during a meeting this
         | morning (had a few tabs and a zoom meeting running). My screen
         | went black and everything locked. I had to hold down the power
         | button to reboot.
        
         | codegeek wrote:
         | Yep. Brought my 16GB Macbook Pro to a halt.
        
           | jcuenod wrote:
           | Sorry, if you want to see the spinning globe, you'll need an
           | M1.
        
       | xmonkee wrote:
       | Can 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 wrote:
         | It'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
        
       | jensenbox wrote:
       | Redis as a primary database gives me chills.
        
       | gnicholas wrote:
       | I 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.
        
         | stjohnswarts wrote:
         | I assume thats because bitly has excellent blocking for known
         | malware sites and techniques (rate limiting/etc) since they've
         | been around for so long.
        
         | steventey wrote:
         | Very 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
        
       | orangepurple wrote:
       | Reminder that there are also great tools designed to do the
       | opposite.
       | 
       | https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
       | 
       | google.com becomes
       | https://aaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...
       | 
       | shadyurl.com was fun while it lasted. Tagline: Don't just shorten
       | your Shady URL, make it suspicious and frightening.
        
         | steventey wrote:
         | Love these lol, really gave me a good laugh when I saw them in
         | the past
        
         | password4321 wrote:
         | Another chance to warn about:
         | 
         |  _Shorten URLs using invisible spaces_
         | 
         | https://github.com/zws-im/zws
        
           | steventey wrote:
           | Whoa, had no idea this was possible. Pretty cool!
        
       | indonxmalon wrote:
        
       | waynesonfire wrote:
       | in rust?
        
       | jawadch93 wrote:
        
       | Rafsark wrote:
       | Is 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"
        
       | dijit wrote:
       | Heh, 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://github.com/dijit/redirector-rs
        
         | steventey wrote:
         | True! 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 :)
        
       | anderspitman wrote:
       | Note 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
        
       | Komodai wrote:
       | Your site is completely killing my browser.
        
       | workingpatrick wrote:
       | nice try nsa
        
       | jeffreygoesto wrote:
       | I read "Billy alternative" and waited for some cool Ikea hack.
       | Bummer.
        
         | steventey wrote:
         | lol that would've been amazing haha
        
       | jedberg wrote:
       | I'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 wrote:
         | I 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 wrote:
           | It's basically an effort to promote code transparency + user
           | privacy, and in general it's just super fun building in
           | public! :)
        
       | jonas-w wrote:
       | Genuine 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?
        
         | sosborn wrote:
         | At 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 wrote:
           | Here we'd also have to go though a vendor review (security,
           | legal, etc.)
        
         | vinaypai wrote:
         | I 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 wrote:
           | That'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 wrote:
         | The 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.
        
       | agucova wrote:
       | I literally spent all day Tuesday trying to find a decent
       | alternative to bit.ly. I'm so glad this exists.
        
         | srhngpr wrote:
         | I have been using https://github.com/YOURLS/YOURLS for years
         | without any issues
        
         | bluelightning2k wrote:
         | If you're spending a day why not just roll your own?
        
           | joshmanders wrote:
           | Because it takes longer than a day to build?
        
         | agentdrtran wrote:
         | Have you looked at Kutt?
        
         | steventey wrote:
         | So glad to hear that!!
        
       | miked85 wrote:
       | The last thing the Internet needs is more link shorteners.
        
       ___________________________________________________________________
       (page generated 2022-09-22 23:01 UTC)