Forum Moderators: coopster

Message Too Old, No Replies

reverse hotlinking . sort of

         

CodilX

11:28 am on Aug 25, 2009 (gmt 0)

10+ Year Member



hi there,

i'm trying to protect my javascript code, and i need some help :)

i have a certain javascript code that is used by a lot of people, and i want to protect the core of it. a certain part of the code is included in the file, and the other part gets loaded from my site

(function(){

GM_xmlhttpRequest({
method: "GET",
url: "http://mysite.com/java.js",
onload: run
});

function run(details) {

if (details.status != 200) {
return;
}

eval(details.responseText);

}

})();

everything works, the file gets loaded and it works perfectly, but it's easy to just open up that file and see the code.

SO..

i'm trying to do a reverse hotlinking, that it would be possible to load the code from the script remotely, and that it would be impossible to open up that .js file using that link.

i'm thinking PHP + .htaccess? or maybe just PHP.. i dunno .. please help :)

oh and my .js file is actualy a .php file, changed with .htaccess

Dinkar

12:50 pm on Aug 25, 2009 (gmt 0)

10+ Year Member



If the file has javascript code then it's better to encrypt it.