title: What is a practice approach to hide the private URL?
body: <p>I haven't found a good solution to this problem and hope somebody has already done something similar. </p>
  
  <p>I wrote a javascript program to load a list of images stored on my server, but I don't want a user to know the directory of my images. </p>
  
  <pre><code>var img1 = new Image();
  img1.src = "my_img_directory/img1.png";
  
  var img2 = new Image();
  img1.src = "my_img_directory/img2.png";
  </code></pre>
  
  <p>In this example, the user will know where I store img1 and img2 on my webserver. Is there a way to prevent them from seeing the URL?</p>
  
  <p>I am thinking about replace the URL with some random string. For example, I can do something like this:</p>
  
  <pre><code>var img1 = new Image();
  img1.src = decode_URL("auiopjlnad103k");
  </code></pre>
  
  <p>But then I still have to map that random string with an absolute path. A user can look at how decode_URL translates the random string to the absolute URL.</p>
  
  <p>If decrypt the random string on the client, a user will figure out a private key and be able to figure out the URL.</p>
  
  <p>Look like I ran out of idea. Is this something that can't be done on client-side alone? Any tip or help will be greatly appreciate! </p>
  
  <p>Thank you.</p>