Pavel Piatruk’ tech & personal blog

Psiphon: setting up own server & Linux client

Psiphon is obfuscated proxy, and its client & server are open-source.

The plan is:

  • setting up own Psiphon server
  • setting up Psiphon Client on Linux that connects to your own Psiphon server

Psiphon Server

Notes:

  • consider changing port from 9991 to something cool e.g. 22, 443 etc…
  • when you change server port or server IP, regenerate the token & update the clients.

    mkdir -p /opt/psiphond-server/
    cd /opt/psiphond-server/
    curl https://github.com/Psiphon-Labs/psiphon-tunnel-core-binaries/raw/master/psiphond/psiphond -o psiphond
    chmod 755 psiphond
    ./psiphond -ipaddress `curl -4 ifconfig.co -Ss`  -protocol OSSH:9991 generate
    cat server-entry.dat ; echo
    

it is the token for clients ; save it.

Run manually …

./psiphond  run

.. or stop & create Systemd unit:

vim /etc/systemd/system/psiphond.service 
[Unit]
After=network.target

[Service]
ExecStart=/opt/psiphond-server/psiphond run
Type=simple
WorkingDirectory=/opt/psiphond-server

[Install]
WantedBy=default.target

Enable the unit:

systemctl daemon-reload
systemct start psiphond.service
systemct enable psiphond.service

Psiphon Client

rm -rf ~/psiphon.client.to.own.server
mkdir -p ~/psiphon.client.to.own.server
cd ~/psiphon.client.to.own.server
curl https://github.com/Psiphon-Labs/psiphon-tunnel-core-binaries/raw/master/linux/psiphon-tunnel-core-x86_64 -o psiphon-tunnel-core-x86_64
chmod 755 psiphon-tunnel-core-x86_64
vim client.own.conf

paste text below but replace __TOKEN__ to the Token from step above.

{
    "LocalHttpProxyPort" : 8081,
    "LocalSocksProxyPort" : 1081,
    "PropagationChannelId" : "FFFFFFFFFFFFFFFF",
    "SponsorId" :            "FFFFFFFFFFFFFFFF",
    "TargetServerEntry" : "__TOKEN__"
}
echo './psiphon-tunnel-core-x86_64 -config client.own.conf' > run.client
chmod 755 run.client
./run.client

It will start Http proxy on local port 8081 and Socks proxy on port 1081. Test those proxies in another console.

curl -x localhost:8081 gmail.com -v 

That gave me 700KB/s speed.