mirokuratczyk e692a20b00 Fix: if nil default value is used 7 سال پیش
..
example 9608aff6e0 Switch back to signed int; validate timeout value 7 سال پیش
.gitignore 8e202da1be gitignore build artifacts 7 سال پیش
Dockerfile d8ea7fff23 Use Go 1.11.1 7 سال پیش
Makefile 30846b1f20 Fix Makefiles 7 سال پیش
PsiphonTunnel.go e692a20b00 Fix: if nil default value is used 7 سال پیش
README.md 6e9b32e0ab Added ClientLibrary build automation 7 سال پیش
USAGE.md 5be8cf6021 Repurpose measurement library as client library 7 سال پیش
build-darwin.sh 90bbb9f3dc Use 'go build -ldflags="-s -w"' to reduce client binary sizes 7 سال پیش
make.bash 90bbb9f3dc Use 'go build -ldflags="-s -w"' to reduce client binary sizes 7 سال پیش
privatePlugins.go 6e9b32e0ab Added ClientLibrary build automation 7 سال پیش

README.md

Psiphon Client Library README

Mobile

If you are planning to embed Psiphon in a mobile application, please use the MobileLibrary.

Usage

If you are using the Library in your app, please read the USAGE.md instructions.

Building for Darwin (iOS, MacOS)

Note that you will need to have Xcode installed on a machine running MacOS.

Run the build:

Ensure that the command below is run from within the ClientLibrary directory

./build-darwin.sh all

This command can also be modified by:

  • replacing all with ios or macos as the first parameter to build-darwin.sh (as in ./build-darwin.sh ios) to only build binaries for the operating system of choice

When that command completes, the compiled binaries will be located in the build directory. The structure will be:

build
└── darwin
    └── ios
    │   └── PsiphonTunnel-ios-arm.h
    │   └── PsiphonTunnel-ios-arm.dylib
    │   └── PsiphonTunnel-ios-arm64.h
    │   └── PsiphonTunnel-ios-arm64.dylib
    └── macos
        └── PsiphonTunnel-macos-386.dylib
        └── PsiphonTunnel-macos-386.dylib
        └── PsiphonTunnel-macos-amd64.dylib
        └── PsiphonTunnel-macos-amd64.dylib

Building with Docker (Android, Linux, Windows)

Note that you may need to use sudo docker below, depending on your OS.

Create the build image:
  1. While in the ClientLibrary directory, run the command: docker build --no-cache=true -t psiclientlibrary-builder .

  2. Once completed, verify that you see an image named psiclientlibrary-builder when running: docker images

Run the build:

Ensure that the command below is run from within the ClientLibrary directory

cd .. && \
  docker run \
  --rm \
  -v $PWD:/go/src/github.com/Psiphon-Labs/psiphon-tunnel-core \
  psiclientlibrary-builder \
  /bin/bash -c './make.bash all' \
; cd -

This command can also be modified by:

  • replacing all with android, linux, or windows as the first parameter to make.bash (as in ./make.bash windows) to only build binaries for the operating system of choice

When that command completes, the compiled binaries will be located in the build directory (./build, and everything under it will likely be owned by root, so be sure to chown to an appropriate user) under the current directory. The structure will be:

build
├── android
│   └── PsiphonTunnel-android-arm7.h
│   └── PsiphonTunnel-android-arm7.so
│   └── PsiphonTunnel-android-arm64.h
│   └── PsiphonTunnel-android-arm64.so
├── linux
│   └── PsiphonTunnel-linux-386.h
│   └── PsiphonTunnel-linux-386.so
│   └── PsiphonTunnel-linux-amd64.h
│   └── PsiphonTunnel-linux-amd64.so
└── windows
    └── PsiphonTunnel-windows-386.h
    └── PsiphonTunnel-windows-386.dll
    └── PsiphonTunnel-windows-amd64.h
    └── PsiphonTunnel-windows-amd64.dll