Live data from Hacker News

Wondering what to do (if anything) about hotlinking

kryogenix.org

11–20 of 49 posts

Re: Wondering what to do (if anything) about hotlinking

#12
I have some rewrite rules to detect it and serve up a small GIF:

http://www.glitchwrks.com/images/general/hotlink.gif

Mostly I had issues with folks hotlinking some of my higher resolution images in their own site/blog/forum posts and claiming it was their work. I set up the rewrite rules after noticing a big spike in bandwidth utilization and seeing a bunch of requests in the logs. Referrer took me back to the offending pieces.

It was suggested to use some sort of shock image instead, now that would be antisocial!

Re: Wondering what to do (if anything) about hotlinking

#13

I have some rewrite rules to detect it and serve up a small GIF: http://www.glitchwrks.com/images/general/hotlink.gif Mostly I had issues with folks hotlinking some of my higher resolution images in their own site/blog/forum posts and claiming it was their work. I set up the rewrite rules after noticing a big spike in bandwidth utilization and seeing a bunch of requests in the logs. Referrer took me back to the offen…

This is 1999 type stuff.

Re: Wondering what to do (if anything) about hotlinking

#15
post #7
post #4

> It’s a bit of an anti-social practice, to be honest Isn't so-called "hot" linking an intended and useful feature of the web? Linking to something directly so that you don't need to copy it to a new server and pollute the URL space with duplicate objects? Maybe someone can invent a way of caching or replicating web content so it doesn't overload the original server and its internet connection. There might even be a…

I read your comment and I thought this was going to be about "links"... but it isn't: it is about embedded resources like scripts or stylesheets. I am with the author on this one: it is really annoying and definitely "anti-social". I've had people do this to me and then I go to update my stylesheet on my website and suddenly a ton of other websites I use are broken and I was like "wtf". After trying to get people to…

Hashes are also what most static site generator and build system use nowadays. This allows for immutable caching which allows the browser to cache the resource indefinitely which just makes things simpler https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Ca...

Re: Wondering what to do (if anything) about hotlinking

#16

The article proposes one solution as being to essentially serve up different content to whoever is hotlinking the script, but then says "Obviously, I don't wanna do this." It seems like the clearest solution to me, so I don't know why it's a bad option. The replacement solution worked for 3D Realms many years ago after a bunch of journalists, fansites, and forums would link to their game screenshots. When someone did…

I guess I'm one of those anti-social people, because my first thought was that anyone hotlinking a script from your server without permission is basically inviting you to deface -- uh, I mean, "creatively redesign" their website for them for free.

Re: Wondering what to do (if anything) about hotlinking

#17

I have some rewrite rules to detect it and serve up a small GIF: http://www.glitchwrks.com/images/general/hotlink.gif Mostly I had issues with folks hotlinking some of my higher resolution images in their own site/blog/forum posts and claiming it was their work. I set up the rewrite rules after noticing a big spike in bandwidth utilization and seeing a bunch of requests in the logs. Referrer took me back to the offen…

This is 1999 type stuff.

Yep, it was used a lot when people would hotlink to their MySpace profile.

still super effective.

Re: Wondering what to do (if anything) about hotlinking

#18

Instead of a nasty console message or popup, modify the script to ping back more detailed and useful information about where its being used. Then contact the developers. Edit: you don't even need to write anything dynamic to receive the ping back, just have the script load an image from yoursite.com/specialprefix/the useresencodedbrowserurl/anythingelseinteresting/1.png then look in your server logs for any 404 error…

And you are now in violation of GDPR

Re: Wondering what to do (if anything) about hotlinking

#19

Instead of a nasty console message or popup, modify the script to ping back more detailed and useful information about where its being used. Then contact the developers. Edit: you don't even need to write anything dynamic to receive the ping back, just have the script load an image from yoursite.com/specialprefix/the useresencodedbrowserurl/anythingelseinteresting/1.png then look in your server logs for any 404 error…

And you are now in violation of GDPR

I'm not an expert on GDPR at all so forgive me if these are dumb questions but how? I thought GDPR pertained to a user's personal info? Sending back info about the webpage the script is used on isn't the same. Also who would be in violation, the leachers or the OP? Does GDPR even apply if OP is just a random person on the internet and not a company operating in the EU?

Re: Wondering what to do (if anything) about hotlinking

#20
I would just add some console.log message explaining the issue you have with hotlinking the script. This will not disrupt users, but anyone who fires up their devtools will see that the site is getting shamed. And if their devs care just a little bit, I think they will find it embarrassing enough to host the script themselves.

Correct me if I simply have missed it, but is there an official NPM package available? I have seen https://www.npmjs.com/package/sorttable and perhaps some of the sites would drop the script tag if "npm install --save-dev sorttable.js" is in the instructions and they have a build step for their JS anyway. Just thinking out loud.

Post reply on HN