Difference between revisions of "Proxy"

From Dreamwidth Notes
Jump to: navigation, search
(What it's for)
Line 1: Line 1:
== Proxy server ==
+
== What it's for ==
 +
 
 +
This is for proxying http: images included in https: Dreamwidth pages. It's probably more useful (and usable) on stand-alonedev environments than on dreamhacks.
 +
 
 +
== Building the proxy server ==
  
 
Code for the proxy is located in $LJHOME/src/proxy.
 
Code for the proxy is located in $LJHOME/src/proxy.
Line 11: Line 15:
  
 
   ./proxy -salt_file=$LJHOME/ext/local/etc/proxy-salt
 
   ./proxy -salt_file=$LJHOME/ext/local/etc/proxy-salt
 
  
 
== Proxy URL in your 'hack ==
 
== Proxy URL in your 'hack ==
 +
 
To enable generation of the proxy URL in your 'hack, set these in your config:
 
To enable generation of the proxy URL in your 'hack, set these in your config:
  

Revision as of 20:08, 14 May 2015

What it's for

This is for proxying http: images included in https: Dreamwidth pages. It's probably more useful (and usable) on stand-alonedev environments than on dreamhacks.

Building the proxy server

Code for the proxy is located in $LJHOME/src/proxy.

Build using go:

 cd $LJHOME/src/proxy
 go build

That will create a binary called proxy in $LJHOME/src/proxy. Run that:

 ./proxy -salt_file=$LJHOME/ext/local/etc/proxy-salt

Proxy URL in your 'hack

To enable generation of the proxy URL in your 'hack, set these in your config:

$PROXY_SALT_FILE = "$HOME/ext/local/etc/proxy-salt";
$PROXY_URL = "https://proxy.hack.dw";
$USE_SSL = 1;

You'll need to create the proxy-salt file. Contents of proxy-salt are just a string, preferably long with randomly generated characters.

You'll also want something in front of the proxy to handle https negotiation. I recommend nginx. Sample config that will work:


    server {
        listen       443 ssl;
        server_name  proxy.hack.dw;
 
        sendfile     off;
 
        location / {
            proxy_pass http://127.0.0.1:6250;
            proxy_redirect off;
        }
    }


(for dev) Make sure you've also got an /etc/hosts entry for `proxy.hack.dw`.