Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jacobfike/5bf151dfc34509cfca84 to your computer and use it in GitHub Desktop.

Select an option

Save jacobfike/5bf151dfc34509cfca84 to your computer and use it in GitHub Desktop.

Revisions

  1. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,12 +1,12 @@
    ### Intro
    ## Intro

    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.

    ### DNS
    ## DNS

    Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is `domain.com`, you'll need a record for that and for `*.domain.com`.

    ### On Server
    ## On Server

    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW. Set it to the base domain, not the wildcard domain.

    @@ -33,7 +33,7 @@ bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAd
    ```


    ### On Client
    ## On Client

    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW. Set it to the base domain, not the wildcard domain.

  2. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -40,5 +40,7 @@ MAKE SURE YOU SET `NGROK_DOMAIN` BELOW. Set it to the base domain, not the wildc
    ```
    NGROK_DOMAIN="my.domain.com"
    echo -e "server_addr: $NGROK_DOMAIN:4443\ntrust_host_root_certs: false" > ngrok-config
    ./ngrok -config=ngrok-config -proto=tcp 22
    ```
    ./ngrok -config=ngrok-config 80
    ```

    Or for SSH forwarding: `./ngrok -config=ngrok-config --proto=tcp 22`
  3. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,7 @@ cp rootCA.pem assets/client/tls/ngrokroot.crt
    make release-server release-client
    ```

    Copy `bin/ngrok` from the server to the client. Then start the server:
    Copy `bin/ngrok` to whatever computer you want to connect from. Then start the server:

    ```
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr=":8000" -httpsAddr=":8001"
  4. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ### Intro

    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with a self-signed SSL cert. Since the client and server are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.
    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with a self-signed SSL cert. Since the client and server executables are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.

    ### DNS

  5. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ### Intro

    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with a self-signed SSL cert. Since the client and daemon are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.
    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with a self-signed SSL cert. Since the client and server are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.

    ### DNS

  6. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    ### Intro

    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with your own self-signed SSL cert. Since the client and daemon are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.
    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with a self-signed SSL cert. Since the client and daemon are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.

    ### DNS

  7. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,6 @@ openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateseria
    cp rootCA.pem assets/client/tls/ngrokroot.crt
    # make clean
    make release-server release-client
    ```

    Copy `bin/ngrok` from the server to the client. Then start the server:
  8. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -25,10 +25,14 @@ cp rootCA.pem assets/client/tls/ngrokroot.crt
    # make clean
    make release-server release-client
    ```

    Copy `bin/ngrok` from the server to the client. Then start the server:

    ```
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr=":8000" -httpsAddr=":8001"
    ```

    Now copy `bin/ngrok` from the server to the client.

    ### On Client

  9. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,7 @@
    ### Intro

    The plan is to create a pair of executables (`ngrok` and `ngrokd`) that are connected with your own self-signed SSL cert. Since the client and daemon are paired, you won't be able to use any other `ngrok` to connect to this `ngrokd`, and vice versa.

    ### DNS

    Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is `domain.com`, you'll need a record for that and for `*.domain.com`.
    @@ -24,12 +28,12 @@ make release-server release-client
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr=":8000" -httpsAddr=":8001"
    ```

    Now copy `bin/ngrok` from the server to the client.

    ### On Client

    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW. Set it to the base domain, not the wildcard domain.

    copy `bin/ngrok` from server to client

    ```
    NGROK_DOMAIN="my.domain.com"
    echo -e "server_addr: $NGROK_DOMAIN:4443\ntrust_host_root_certs: false" > ngrok-config
  10. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,11 @@
    Note: make sure you set the Common Name on the SSL certs to `sub.domain.com`, not the wildcard `*.sub.domain.com`.
    ### DNS

    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW IN BOTH SERVER AND CLIENT SECTION
    Add two DNS records: one for the base domain and one for the wildcard domain. For example, if your base domain is `domain.com`, you'll need a record for that and for `*.domain.com`.

    ### On Server

    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW. Set it to the base domain, not the wildcard domain.

    ```
    NGROK_DOMAIN="my.domain.com"
    git clone https://github.com/inconshreveable/ngrok.git
    @@ -24,6 +26,8 @@ bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAd

    ### On Client

    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW. Set it to the base domain, not the wildcard domain.

    copy `bin/ngrok` from server to client

    ```
  11. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ cp rootCA.pem assets/client/tls/ngrokroot.crt
    # make clean
    make release-server release-client
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr="" -httpsAddr=""
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr=":8000" -httpsAddr=":8001"
    ```

    ### On Client
  12. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -24,7 +24,7 @@ bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAd

    ### On Client

    copy bin/ngrok from server to client
    copy `bin/ngrok` from server to client

    ```
    NGROK_DOMAIN="my.domain.com"
  13. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 10 additions and 5 deletions.
    15 changes: 10 additions & 5 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    Note: make sure you set the Common Name on the SSL certs to `sub.domain.com`, not the wildcard `*.sub.domain.com`.

    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW
    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW IN BOTH SERVER AND CLIENT SECTION

    ### On Server

    ```
    NGROK_DOMAIN="my.domain.com"
    @@ -17,12 +19,15 @@ cp rootCA.pem assets/client/tls/ngrokroot.crt
    # make clean
    make release-server release-client
    # copy bin/ngrok to client
    # on server
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr="" -httpsAddr=""
    ```

    ### On Client

    #on client
    copy bin/ngrok from server to client

    ```
    NGROK_DOMAIN="my.domain.com"
    echo -e "server_addr: $NGROK_DOMAIN:4443\ntrust_host_root_certs: false" > ngrok-config
    ./ngrok -config=ngrok-config -proto=tcp 22
    ```
  14. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    Note: make sure you set the Common Name on the SSL certs to `sub.domain.com`, not the wildcard `*.sub.domain.com`.

    MAKE SURE YOU SET NGROK_DOMAIN BELOW
    MAKE SURE YOU SET `NGROK_DOMAIN` BELOW

    ```
    NGROK_DOMAIN="my.domain.com"
  15. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,16 @@
    Note: make sure you set the Common Name on the SSL certs to `sub.domain.com`, not the wildcard `*.sub.domain.com`.

    MAKE SURE YOU SET NGROK_DOMAIN BELOW

    ```
    export NGROK_DOMAIN="my.domain.com"
    NGROK_DOMAIN="my.domain.com"
    git clone https://github.com/inconshreveable/ngrok.git
    cd ngrok
    openssl genrsa -out rootCA.key 2048
    openssl req -x509 -new -nodes -key rootCA.key -subj "/C=US/ST=NY/L=/O=IT/CN=$NGROK_DOMAIN" -days 1024 -out rootCA.pem
    openssl req -x509 -new -nodes -key rootCA.key -subj "/CN=$NGROK_DOMAIN" -days 1024 -out rootCA.pem
    openssl genrsa -out device.key 2048
    openssl req -new -key device.key -subj "/C=US/ST=NY/L=/O=IT/CN=$NGROK_DOMAIN" -out device.csr
    openssl req -new -key device.key -subj "/CN=$NGROK_DOMAIN" -out device.csr
    openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 500
    cp rootCA.pem assets/client/tls/ngrokroot.crt
  16. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -12,9 +12,8 @@ openssl req -new -key device.key -subj "/C=US/ST=NY/L=/O=IT/CN=$NGROK_DOMAIN" -o
    openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 500
    cp rootCA.pem assets/client/tls/ngrokroot.crt
    make clean
    make release-server
    make release-client
    # make clean
    make release-server release-client
    # copy bin/ngrok to client
  17. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -11,7 +11,7 @@ openssl genrsa -out device.key 2048
    openssl req -new -key device.key -subj "/C=US/ST=NY/L=/O=IT/CN=$NGROK_DOMAIN" -out device.csr
    openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 500
    mv rootCA.pem assets/client/tls/ngrokroot.crt
    cp rootCA.pem assets/client/tls/ngrokroot.crt
    make clean
    make release-server
    make release-client
  18. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,14 @@
    Note: make sure you set the Common Name on the SSL certs to `sub.domain.com`, not the wildcard `*.sub.domain.com`.

    ```
    export NGROK_DOMAIN="my.domain.com"
    git clone https://github.com/inconshreveable/ngrok.git
    cd ngrok
    openssl genrsa -out rootCA.key 2048
    openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem
    openssl req -x509 -new -nodes -key rootCA.key -subj "/C=US/ST=NY/L=/O=IT/CN=$NGROK_DOMAIN" -days 1024 -out rootCA.pem
    openssl genrsa -out device.key 2048
    openssl req -new -key device.key -out device.csr
    openssl req -new -key device.key -subj "/C=US/ST=NY/L=/O=IT/CN=$NGROK_DOMAIN" -out device.csr
    openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 500
    mv rootCA.pem assets/client/tls/ngrokroot.crt
    @@ -18,9 +19,9 @@ make release-client
    # copy bin/ngrok to client
    # on server
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="sub.domain.com" -httpAddr="" -httpsAddr=""
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="$NGROK_DOMAIN" -httpAddr="" -httpsAddr=""
    #on client
    echo -e "server_addr: sub.domain.com:4443\ntrust_host_root_certs: false" > ngrok-config
    echo -e "server_addr: $NGROK_DOMAIN:4443\ntrust_host_root_certs: false" > ngrok-config
    ./ngrok -config=ngrok-config -proto=tcp 22
    ```
  19. @lyoshenka lyoshenka revised this gist May 23, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,6 @@ make release-client
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="sub.domain.com" -httpAddr="" -httpsAddr=""
    #on client
    echo "server_addr: sub.domain.com:4443\ntrust_host_root_certs: false" > ngrok-config
    echo -e "server_addr: sub.domain.com:4443\ntrust_host_root_certs: false" > ngrok-config
    ./ngrok -config=ngrok-config -proto=tcp 22
    ```
  20. @lyoshenka lyoshenka created this gist May 23, 2014.
    26 changes: 26 additions & 0 deletions ngrok-selfhosting-setup.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    Note: make sure you set the Common Name on the SSL certs to `sub.domain.com`, not the wildcard `*.sub.domain.com`.

    ```
    git clone https://github.com/inconshreveable/ngrok.git
    cd ngrok
    openssl genrsa -out rootCA.key 2048
    openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem
    openssl genrsa -out device.key 2048
    openssl req -new -key device.key -out device.csr
    openssl x509 -req -in device.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial -out device.crt -days 500
    mv rootCA.pem assets/client/tls/ngrokroot.crt
    make clean
    make release-server
    make release-client
    # copy bin/ngrok to client
    # on server
    bin/ngrokd -tlsKey=device.key -tlsCrt=device.crt -domain="sub.domain.com" -httpAddr="" -httpsAddr=""
    #on client
    echo "server_addr: sub.domain.com:4443\ntrust_host_root_certs: false" > ngrok-config
    ./ngrok -config=ngrok-config -proto=tcp 22
    ```