Liking cljdoc? Tell your friends :D

nrepl.tls-client-proxy

Proxy a local regular TCP connection to a remote TLS TCP connection. Can be used if your editor/IDE does not (yet) support TLS connections.

Example usage: $ clojure -Sdeps '{:aliases {:proxy {:deps {nrepl/nrepl {:mvn/version "1.0.0"}} :exec-fn nrepl.tls-client-proxy/start-tls-proxy :exec-args {:remote-host "localhost" :remote-port 4001 :bind 9001 :tls-keys-file "client.keys"}}}}' -T:proxy

This will start a standalone program that will forward local TCP connections on 127.0.0.1:9001 to the remote TLS TCP connection at 127.0.0.1:4001 using the key provided in the file client.keys.

Proxy a local regular TCP connection to a remote TLS TCP connection.
Can be used if your editor/IDE does not (yet) support TLS connections.

Example usage:
$ clojure -Sdeps '{:aliases {:proxy {:deps {nrepl/nrepl {:mvn/version "1.0.0"}} :exec-fn nrepl.tls-client-proxy/start-tls-proxy :exec-args {:remote-host "localhost" :remote-port 4001 :bind 9001 :tls-keys-file "client.keys"}}}}' -T:proxy

This will start a standalone program that will forward local TCP connections on 127.0.0.1:9001
to the remote TLS TCP connection at 127.0.0.1:4001 using the key provided in the file `client.keys`.
raw docstring

socket-threadcljmacro

(socket-thread state sock other-sock f)
source

start-tls-proxyclj

(start-tls-proxy {:keys [remote-host remote-port tls-keys-str tls-keys-file bind
                         port port-file block? state connect-timeout-ms]
                  :or {bind "127.0.0.1"
                       port 0
                       port-file ".nrepl-tls-proxy-port"
                       connect-timeout-ms 10000
                       block? true
                       state (atom {})}})

Start a local TLS proxy. This will forward a local regular TCP connection to a remote TLS TCP connection.

Required options:

  • :remote-host - The host that is hosting a TLS nREPL server
  • :remote-port - The port of the remote host that is hosting a TLS nREPL server
  • One of: :tls-keys-file - The TLS certificates and key to use is located in this file :tls-keys-str - The TLS certificates and key to use in the form of a string

Other configuration options include:

  • :port — defaults to 0, which autoselects an open port. The port number will be written to :port-file
  • :bind - bind address, by default "127.0.0.1"
  • :port-file - where to write the port number. Defaults to ".nrepl-tls-proxy-port"
  • :connect-timeout-ms - Connection timeout in milliseconds. Defaults to 10000.
  • :block? - Whether to block or not in this function. Defaults to true. For REPL usage/testing you'll want to set this to false.

Return value: If :block? is false, this function will return a state atom. You can stop this server with (stop! state). If :block? is true, i.e. the default value, this function will not return (and exit) before the end user presses Ctrl-C.

Start a local TLS proxy. This will forward a local regular TCP connection to a remote TLS TCP connection.

Required options:

* :remote-host - The host that is hosting a TLS nREPL server
* :remote-port - The port of the remote host that is hosting a TLS nREPL server
* One of:
  :tls-keys-file - The TLS certificates and key to use is located in this file
  :tls-keys-str - The TLS certificates and key to use in the form of a string

Other configuration options include:
* :port — defaults to 0, which autoselects an open port. The port number will be written to :port-file
* :bind - bind address, by default "127.0.0.1"
* :port-file - where to write the port number. Defaults to ".nrepl-tls-proxy-port"
* :connect-timeout-ms - Connection timeout in milliseconds. Defaults to 10000.
* :block? - Whether to block or not in this function. Defaults to true. For REPL usage/testing you'll want to set this to false.

Return value:
If :block? is false, this function will return a state atom. You can stop this server with `(stop! state)`.
If :block? is true, i.e. the default value, this function will not return (and exit) before the end user presses Ctrl-C.
sourceraw docstring

stop!clj

(stop! state)

Stops all threads and closes all sockets associated with this TLS proxy. Waits for threads to exit.

Stops all threads and closes all sockets associated with this TLS proxy. Waits for threads to exit.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close