{"id":19792017,"url":"https://github.com/making/rsc","last_synced_at":"2025-10-06T06:50:06.673Z","repository":{"id":38374916,"uuid":"224445169","full_name":"making/rsc","owner":"making","description":"RSocket Client CLI (RSC) that aims to be a curl for RSocket","archived":false,"fork":false,"pushed_at":"2023-03-06T20:11:35.000Z","size":356,"stargazers_count":249,"open_issues_count":18,"forks_count":28,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-20T06:05:38.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/making.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-11-27T14:08:56.000Z","updated_at":"2025-05-07T11:41:17.000Z","dependencies_parsed_at":"2025-02-07T02:00:42.619Z","dependency_job_id":"157f0678-5012-4b9b-be0b-2ac6ac66dd63","html_url":"https://github.com/making/rsc","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"purl":"pkg:github/making/rsc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Frsc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Frsc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Frsc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Frsc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/making","download_url":"https://codeload.github.com/making/rsc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/making%2Frsc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278571988,"owners_count":26008686,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-06T02:00:05.630Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T07:05:41.898Z","updated_at":"2025-10-06T06:50:06.617Z","avatar_url":"https://github.com/making.png","language":"Java","readme":"# RSocket Client CLI (RSC)\n[![CI](https://github.com/making/rsc/workflows/CI/badge.svg)](https://github.com/making/rsc/actions?query=workflow%3ACI)\n\n\u003e Aiming to be a curl for RSocket\n\n```\nusage: rsc [options] uri\n\nNon-option arguments:\n[String: uri]        \n\nOption                                Description                            \n------                                -----------                            \n--ab, --authBearer [String]           Enable Authentication Metadata         \n                                        Extension (Bearer).                  \n--authBasic [String]                  [DEPRECATED] Enable Authentication     \n                                        Metadata Extension (Basic). This     \n                                        Metadata exists only for the         \n                                        backward compatibility with Spring   \n                                        Security 5.2                         \n--channel                             Shortcut of --im REQUEST_CHANNEL       \n--completion [ShellType]              Output shell completion code for the   \n                                        specified shell (bash, zsh, fish,    \n                                        powershell)                          \n-d, --data [String]                   Data. Use '-' to read data from        \n                                        standard input. (default: )          \n--dataMimeType, --dmt [String]        MimeType for data (default:            \n                                        application/json)                    \n--debug                               Enable FrameLogger                     \n--delayElements [Long]                Enable delayElements(delay) in milli   \n                                        seconds                              \n--dumpOpts                            Dump options as a file that can be     \n                                        loaded by --optsFile option          \n--fnf                                 Shortcut of --im FIRE_AND_FORGET       \n-h, --help [String]                   Print help                             \n--im, --interactionModel              InteractionModel (default:             \n  [InteractionModel]                    REQUEST_RESPONSE)                    \n-l, --load [String]                   Load a file as Data. (e.g. ./foo.txt,  \n                                        /tmp/foo.txt, https://example.com)   \n--limitRate [Integer]                 Enable limitRate(rate)                 \n--log [String]                        Enable log()                           \n-m, --metadata [String]               Metadata (default: )                   \n--metadataMimeType, --mmt [String]    MimeType for metadata (default:        \n                                        application/json)                    \n--optsFile [String]                   Configure options from a YAML file (e. \n                                        g. ./opts.yaml, /tmp/opts.yaml,      \n                                        https://example.com/opts.yaml)       \n--printB3                             Print B3 propagation info. Ignored     \n                                        unless --trace is set.               \n-q, --quiet                           Disable the output on next             \n-r, --route [String]                  Enable Routing Metadata Extension      \n--request                             Shortcut of --im REQUEST_RESPONSE      \n--resume [Integer]                    Enable resume. Resume session duration \n                                        can be configured in seconds.        \n--retry [Integer]                     Enable retry. Retry every 1 second     \n                                        with the given max attempts.         \n--sd, --setupData [String]            Data for Setup payload                 \n--setupMetadata, --sm [String]        Metadata for Setup payload             \n--setupMetadataMimeType, --smmt       Metadata MimeType for Setup payload    \n  [String]                              (default: application/json)          \n--showSystemProperties                Show SystemProperties for troubleshoot \n--stacktrace                          Show Stacktrace when an exception      \n                                        happens                              \n--stream                              Shortcut of --im REQUEST_STREAM        \n--take [Integer]                      Enable take(n)                         \n--trace [TracingMetadataCodec$Flags]  Enable Tracing (Zipkin) Metadata       \n                                        Extension. Unless sampling state     \n                                        (UNDECIDED, NOT_SAMPLE, SAMPLE,      \n                                        DEBUG) is specified, DEBUG is used   \n                                        if no state is specified.            \n--trustCert [String]                  PEM file for a trusted certificate. (e.\n                                        g. ./foo.crt, /tmp/foo.crt, https:   \n                                        //example.com/foo.crt)               \n-u, --as, --authSimple [String]       Enable Authentication Metadata         \n                                        Extension (Simple). The format must  \n                                        be 'username:password'.              \n-v, --version                         Print version                          \n-w, --wiretap                         Enable wiretap                         \n--wsHeader, --wsh [String]            Header for web socket connection       \n--zipkinUrl [String]                  Zipkin URL to send a span (e.g. http:  \n                                        //localhost:9411). Ignored unless -- \n                                        trace is set.                                                                   \n```\n\n## Install\n\nDownload an executable jar or native binary from [Releases](https://github.com/making/rsc/releases).\n\nTo get `rsc` binary working on Windows, you will need to install [Visual C++ Redistributable Packages](https://www.microsoft.com/en-us/download/details.aspx?id=48145) in advance.\n\n### Install via Homebrew (Mac / Linux)\n[![Homebrew](https://github.com/making/rsc/workflows/Homebrew/badge.svg)](https://github.com/making/rsc/actions?query=workflow%3AHomebrew)\n\nYou can install native binary for Mac or Linux via [Homebrew](https://brew.sh/).\n\n```\nbrew install making/tap/rsc\n```\n\n### Install via Scoop (Windows)\n[![Scoop](https://github.com/making/rsc/workflows/Scoop/badge.svg)](https://github.com/making/rsc/actions?query=workflow%3AScoop)\n\nYou can install native binary for Windows via [Scoop](https://scoop.sh/).\n\n```\nscoop bucket add making https://github.com/making/scoop-bucket.git\nscoop update\nscoop install rsc\n```\n\n### Install via Coursier (Mac / Linux / Windows)\n[![Coursier](https://github.com/making/rsc/workflows/Coursier/badge.svg)](https://github.com/making/rsc/actions?query=workflow%3ACoursier)\n\nIf you do not already have [couriser](https://get-coursier.io) installed on your machine, install it following steps given here: https://get-coursier.io/docs/cli-installation. \n\nTo install the graalvm binary do: \n\n```\ncs install rsc --contrib\n``` \n\nTo install the jvm binary (executable jar) do:\n\n```\ncs install rscj --contrib\n```\n\n## Example usages\n\n```\nrsc --request --route=uppercase --data=Foo --debug tcp://localhost:7001\n```\n\n```\nrsc --stream --route=hello --debug --take=30 ws://localhost:8080/rsocket\n```\n\n```\nrsc --stream --route=searchTweets --data=Trump wss://demo.rsocket.io/rsocket\n```\n\nYou can also send data via a file or URL using `-l`/`--load` option instead of `-d`/`--data` as follows\n\n```\nrsc --request --route=hello --load=./hello.txt --debug tcp://localhost:8080\nrsc --request --route=hello --load=/tmp/hello.txt --debug tcp://localhost:8080\nrsc --request --route=hello --load=https://example.com --debug tcp://localhost:8080\n```\n\n## Enable shell autocompletion \n\nrsc (0.8.0+) provides autocompletion support for Bash, Zsh, Fish and Powershell.\n\n```\nrsc --completion \u003cSHELL\u003e\n```\n\nshows the completion script.\n\n![rsc-completion](https://user-images.githubusercontent.com/106908/106292859-af40bc00-6290-11eb-9f76-99b0d5e2914a.gif)\n\nIf you install `rsc` via Homebrew, the completion script is also installed under `/usr/local/Homebrew/completions/`.\n\nBelow are the procedures to set up autocompletion manually.\n\n### Zsh\n\nAdd the following to the beginning of your `~/.zshrc`\n\n```\nautoload -Uz compinit \u0026\u0026 compinit\n```\n\nYou now need to ensure that the rsc completion script gets sourced in all your shell sessions. \n\n```\necho 'source \u003c(rsc --completion bash)' \u003e\u003e~/.zshrc\n```\n\n### Bash\n\nthe completion script depends on [bash-completion](https://github.com/scop/bash-completion).\n\n#### on Mac\n\nthe completion script doesn't work with Bash 3.2 which is the default bash version on Mac.\nIt requires Bash 4.1+ and bash-completion v2. \n\nYou can install these as follows\n\n```\nbrew install bash\nbrew install bash-completion@2\n```\n\nMake sure `bash -v` shows 4.1+.\n\nAdd the bellow to your `~/.bash_profile`\n\n```\n[[ -r \"/usr/local/etc/profile.d/bash_completion.sh\" ]] \u0026\u0026 . \"/usr/local/etc/profile.d/bash_completion.sh\"\n```\n\nYou now need to ensure that the rsc completion script gets sourced in all your shell sessions. \n\n```\necho 'source \u003c(rsc --completion bash)' \u003e\u003e~/.bash_profile\n```\n\n#### on Linux\nYou can install bash-completion with `apt-get install bash-completion` or `yum install bash-completion`, etc.\n\nAdd `source /usr/share/bash-completion/bash_completion` to your `~/.bashrc`.\n\nYou now need to ensure that the rsc completion script gets sourced in all your shell sessions. \n\n```\necho 'source \u003c(rsc --completion bash)' \u003e\u003e~/.bashrc\n```\n\n### Fish\n\nTBD (help wanted)\n\n```\nrsc --completion fish\n```\n\n### Powershell\n\n```\nrsc --completion powershell | Out-String | Invoke-Expression\n```\n\n## Log options\n\n### Default\n\nBy default, the data of the payload will be output (since 0.2.0).\n\n```\n$ rsc --route=add --data='{\"x\":10, \"y\":20}' tcp://localhost:7001\n{\"result\":30}\n```\n\n### Enable Reactor's log() operator\n\n`--log` option enables Reactive Stream Level log. `--quiet`/`-q` option disables the default output.\n\n```\n$ rsc --route=add --data='{\"x\":10, \"y\":20}' --log --quiet tcp://localhost:7001 \n2021-02-06 17:50:15.809  INFO 95810 --- [actor-tcp-nio-2] rsc                                      : onSubscribe(FluxMap.MapSubscriber)\n2021-02-06 17:50:15.809  INFO 95810 --- [actor-tcp-nio-2] rsc                                      : request(unbounded)\n2021-02-06 17:50:15.820  INFO 95810 --- [actor-tcp-nio-2] rsc                                      : onNext({\"result\":30})\n2021-02-06 17:50:15.820  INFO 95810 --- [actor-tcp-nio-2] rsc                                      : onComplete()\n```\n\n### Enable FrameLogger\n\n`--debug` option enables RSocket Level log.\n\n```\n$ rsc --route=add --data='{\"x\":10, \"y\":20}' --debug --quiet tcp://localhost:7001\n2021-02-06 17:50:32.560 DEBUG 95820 --- [actor-tcp-nio-2] io.rsocket.FrameLogger                   : sending -\u003e \nFrame =\u003e Stream ID: 0 Type: SETUP Flags: 0b0 Length: 75\nData:\n\n2021-02-06 17:50:32.560 DEBUG 95820 --- [actor-tcp-nio-2] io.rsocket.FrameLogger                   : sending -\u003e \nFrame =\u003e Stream ID: 1 Type: REQUEST_RESPONSE Flags: 0b100000000 Length: 33\nMetadata:\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| fe 00 00 04 03 61 64 64                         |.....add        |\n+--------+-------------------------------------------------+----------------+\nData:\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 7b 22 78 22 3a 31 30 2c 20 22 79 22 3a 32 30 7d |{\"x\":10, \"y\":20}|\n+--------+-------------------------------------------------+----------------+\n2021-02-06 17:50:32.571 DEBUG 95820 --- [actor-tcp-nio-2] io.rsocket.FrameLogger                   : receiving -\u003e \nFrame =\u003e Stream ID: 1 Type: NEXT_COMPLETE Flags: 0b1100000 Length: 19\nData:\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 7b 22 72 65 73 75 6c 74 22 3a 33 30 7d          |{\"result\":30}   |\n+--------+-------------------------------------------------+----------------+\n```\n\n### Enable Reactor's wiretap\n\n`--wiretap`/`-w` option enables TCP Level log.\n\n\n```\n$ rsc --route=add --data='{\"x\":10, \"y\":20}' --wiretap --quiet tcp://localhost:7001\n2021-02-06 17:51:20.140 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe] REGISTERED\n2021-02-06 17:51:20.141 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe] CONNECT: localhost/127.0.0.1:7001\n2021-02-06 17:51:20.141 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe, L:/127.0.0.1:62801 - R:localhost/127.0.0.1:7001] ACTIVE\n2021-02-06 17:51:20.141 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe, L:/127.0.0.1:62801 - R:localhost/127.0.0.1:7001] WRITE: 78B\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 00 00 4b 00 00 00 00 04 00 00 01 00 00 00 00 4e |..K............N|\n|00000010| 20 00 01 5f 90 27 6d 65 73 73 61 67 65 2f 78 2e | .._.'message/x.|\n|00000020| 72 73 6f 63 6b 65 74 2e 63 6f 6d 70 6f 73 69 74 |rsocket.composit|\n|00000030| 65 2d 6d 65 74 61 64 61 74 61 2e 76 30 10 61 70 |e-metadata.v0.ap|\n|00000040| 70 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e       |plication/json  |\n+--------+-------------------------------------------------+----------------+\n2021-02-06 17:51:20.142 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe, L:/127.0.0.1:62801 - R:localhost/127.0.0.1:7001] WRITE: 36B\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 00 00 21 00 00 00 01 11 00 00 00 08 fe 00 00 04 |..!.............|\n|00000010| 03 61 64 64 7b 22 78 22 3a 31 30 2c 20 22 79 22 |.add{\"x\":10, \"y\"|\n|00000020| 3a 32 30 7d                                     |:20}            |\n+--------+-------------------------------------------------+----------------+\n2021-02-06 17:51:20.142 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe, L:/127.0.0.1:62801 - R:localhost/127.0.0.1:7001] FLUSH\n2021-02-06 17:51:20.152 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe, L:/127.0.0.1:62801 - R:localhost/127.0.0.1:7001] READ: 22B\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 00 00 13 00 00 00 01 28 60 7b 22 72 65 73 75 6c |.......(`{\"resul|\n|00000010| 74 22 3a 33 30 7d                               |t\":30}          |\n+--------+-------------------------------------------------+----------------+\n2021-02-06 17:51:20.152 DEBUG 95837 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x39d9fefe, L:/127.0.0.1:62801 - R:localhost/127.0.0.1:7001] READ COMPLETE\n```\n\n## Setup payload\n\nThe data in `SETUP` payload can be specified by `--setupData`/`--sd` option and metadata can be specified by `--setupMetaData`/`--smd`.\nAlso the MIME type of the setup metadata can be specified by `--setupMetadataMimeType`/`--smmt` option.\n\nFor example:\n\n```\nrsc --setupData=foo --setupMetadata='{\"value\":\"metadata\"}' --setupMetadataMimeType=application/json --route=add --data='{\"x\":10, \"y\":20}' tcp://localhost:7001\n```\n\nAs of 0.6.0, the following MIME types are supported.\n\n* `application/json` (default)\n* `text/plain`\n* `message/x.rsocket.authentication.v0`\n* `message/x.rsocket.authentication.basic.v0`\n* `message/x.rsocket.application+json` (0.7.1+)\n\nAccordingly, enum name of [`SetupMetadataMimeType`](https://github.com/making/rsc/blob/master/src/main/java/am/ik/rsocket/SetupMetadataMimeType.java) instead can be used with `--smmt` option\n\n* `APPLICATION_JSON`\n* `TEXT_PLAIN`\n* `MESSAGE_RSOCKET_AUTHENTICATION`\n* `AUTHENTICATION_BASIC`\n* `APP_INFO` (0.7.1+)\n\n## Composite Metadata\n\n`rsc` always uses [Composite Metadata Extension](https://github.com/rsocket/rsocket/blob/master/Extensions/CompositeMetadata.md).\nIf multiple metadataMimeTypes are specified, they are automatically composed (the order matters).\n\n```\n$ rsc --metadataMimeType=text/plain --metadata=hello --metadataMimeType=application/json --metadata='{\"hello\":\"world\"}' --data='{\"x\":10, \"y\":20}' --wiretap --quiet tcp://localhost:7001\n2021-02-06 18:00:29.100 DEBUG 95998 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x9c1425b3] REGISTERED\n2021-02-06 18:00:29.101 DEBUG 95998 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x9c1425b3] CONNECT: localhost/127.0.0.1:7001\n2021-02-06 18:00:29.101 DEBUG 95998 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x9c1425b3, L:/127.0.0.1:62844 - R:localhost/127.0.0.1:7001] ACTIVE\n2021-02-06 18:00:29.102 DEBUG 95998 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x9c1425b3, L:/127.0.0.1:62844 - R:localhost/127.0.0.1:7001] WRITE: 78B\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 00 00 4b 00 00 00 00 04 00 00 01 00 00 00 00 4e |..K............N|\n|00000010| 20 00 01 5f 90 27 6d 65 73 73 61 67 65 2f 78 2e | .._.'message/x.|\n|00000020| 72 73 6f 63 6b 65 74 2e 63 6f 6d 70 6f 73 69 74 |rsocket.composit|\n|00000030| 65 2d 6d 65 74 61 64 61 74 61 2e 76 30 10 61 70 |e-metadata.v0.ap|\n|00000040| 70 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e       |plication/json  |\n+--------+-------------------------------------------------+----------------+\n2021-02-06 18:00:29.102 DEBUG 95998 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x9c1425b3, L:/127.0.0.1:62844 - R:localhost/127.0.0.1:7001] WRITE: 58B\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 00 00 37 00 00 00 01 11 00 00 00 1e a1 00 00 05 |..7.............|\n|00000010| 68 65 6c 6c 6f 85 00 00 11 7b 22 68 65 6c 6c 6f |hello....{\"hello|\n|00000020| 22 3a 22 77 6f 72 6c 64 22 7d 7b 22 78 22 3a 31 |\":\"world\"}{\"x\":1|\n|00000030| 30 2c 20 22 79 22 3a 32 30 7d                   |0, \"y\":20}      |\n+--------+-------------------------------------------------+----------------+\n2021-02-06 18:00:29.102 DEBUG 95998 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0x9c1425b3, L:/127.0.0.1:62844 - R:localhost/127.0.0.1:7001] FLUSH\n...\n```\n\n`--route` option is still respected.\n\n```\n$ rsc --metadataMimeType=text/plain --metadata=hello --metadataMimeType=application/json --metadata='{\"hello\":\"world\"}' --route=add --data='{\"x\":10, \"y\":20}' --wiretap --quiet tcp://localhost:7001\n2021-02-06 18:01:28.434 DEBUG 96015 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0xf49f4cd5] REGISTERED\n2021-02-06 18:01:28.435 DEBUG 96015 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0xf49f4cd5] CONNECT: localhost/127.0.0.1:7001\n2021-02-06 18:01:28.435 DEBUG 96015 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0xf49f4cd5, L:/127.0.0.1:62848 - R:localhost/127.0.0.1:7001] ACTIVE\n2021-02-06 18:01:28.436 DEBUG 96015 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0xf49f4cd5, L:/127.0.0.1:62848 - R:localhost/127.0.0.1:7001] WRITE: 78B\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 00 00 4b 00 00 00 00 04 00 00 01 00 00 00 00 4e |..K............N|\n|00000010| 20 00 01 5f 90 27 6d 65 73 73 61 67 65 2f 78 2e | .._.'message/x.|\n|00000020| 72 73 6f 63 6b 65 74 2e 63 6f 6d 70 6f 73 69 74 |rsocket.composit|\n|00000030| 65 2d 6d 65 74 61 64 61 74 61 2e 76 30 10 61 70 |e-metadata.v0.ap|\n|00000040| 70 6c 69 63 61 74 69 6f 6e 2f 6a 73 6f 6e       |plication/json  |\n+--------+-------------------------------------------------+----------------+\n2021-02-06 18:01:28.436 DEBUG 96015 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0xf49f4cd5, L:/127.0.0.1:62848 - R:localhost/127.0.0.1:7001] WRITE: 66B\n         +-------------------------------------------------+\n         |  0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f |\n+--------+-------------------------------------------------+----------------+\n|00000000| 00 00 3f 00 00 00 01 11 00 00 00 26 fe 00 00 04 |..?........\u0026....|\n|00000010| 03 61 64 64 a1 00 00 05 68 65 6c 6c 6f 85 00 00 |.add....hello...|\n|00000020| 11 7b 22 68 65 6c 6c 6f 22 3a 22 77 6f 72 6c 64 |.{\"hello\":\"world|\n|00000030| 22 7d 7b 22 78 22 3a 31 30 2c 20 22 79 22 3a 32 |\"}{\"x\":10, \"y\":2|\n|00000040| 30 7d                                           |0}              |\n+--------+-------------------------------------------------+----------------+\n2021-02-06 18:01:28.437 DEBUG 96015 --- [actor-tcp-nio-2] reactor.netty.tcp.TcpClient              : [id: 0xf49f4cd5, L:/127.0.0.1:62848 - R:localhost/127.0.0.1:7001] FLUSH\n...\n```\n\nIf you use `--route/-r` option, you need to specify to `--metadataMimeType/--mmt` option for the additional metadata even if the type is `application/json` which is the default mime type.\n\nFor example:\n\n```\nrsc -r functionRouter --mmt application/json -m '{\"function\":\"uppercase\"}' -d 'RSocket' tcp://localhost:8080\n``` \n\n## Backpressure\n\nThe `onNext` output can be delayed with the `--delayElements` (milli seconds) option.　Accordingly, the number of `request` will be automatically adjusted.\n\n```\n$ rsc --stream --delayElements=100 --log --route=uppercase.stream --data=rsocket tcp://localhost:7001     \n2021-02-06 18:14:18.230  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onSubscribe(FluxMap.MapSubscriber)\n2021-02-06 18:14:18.230  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : request(32)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.235  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:18.236  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\n2021-02-06 18:14:20.595  INFO 96438 --- [     parallel-8] rsc                                      : request(24)\n2021-02-06 18:14:20.598  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:14:20.598  INFO 96438 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n...\n```\n\nYou can also limit the number of `request` with `--limitRate` option.\n\n```\n$ rsc --stream --delayElements=100 --limitRate=8 --log --route=uppercase.stream --data=rsocket tcp://localhost:7001\n2021-02-06 18:06:04.919  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onSubscribe(FluxMap.MapSubscriber)\n2021-02-06 18:06:04.919  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : request(8)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:04.922  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\n2021-02-06 18:06:05.435  INFO 96118 --- [     parallel-6] rsc                                      : request(6)\n2021-02-06 18:06:05.439  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:05.439  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:05.439  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:05.439  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:05.439  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:05.439  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\n2021-02-06 18:06:06.048  INFO 96118 --- [    parallel-12] rsc                                      : request(6)\n2021-02-06 18:06:06.050  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:06.050  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:06.050  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:06.050  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:06.050  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\n2021-02-06 18:06:06.050  INFO 96118 --- [actor-tcp-nio-2] rsc                                      : onNext(RSOCKET)\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\nRSOCKET\n...\n```\n\n**Tip**: Using `--limitRate 1 --delayElements 1000 --debug` is a convenient way to trace a stream.\n\n## Authentication\n\n`rsc` supports [Authentication Extension](https://github.com/rsocket/rsocket/blob/master/Extensions/Security/Authentication.md) since 0.6.0.\n\nThe demo application is [here](https://github.com/making/demo-rsocket-security).\n\nNote that since RSocket Java 1.0.3, [username field length is extended](https://github.com/rsocket/rsocket-java/pull/938).\n\nrsc 0.6.0 uses RSocket Java 1.0.2. To support extended username, rsc 0.7.0 which uses RSocket Java 1.1.0 or above is required. \n\n### [Simple Authentication Type](https://github.com/rsocket/rsocket/blob/master/Extensions/Security/Simple.md)\n\n\nTo send credentials per stream, use `--authSimple \u003cusername\u003e:\u003cpassword\u003e` option as follows: \n\n```\nrsc tcp://localhost:8888 --authSimple user:password -r hello -d World\n```\n\nFor shorter options, `--as` or `-u` (like `curl`!) are also available.\n\n```\nrsc tcp://localhost:8888 -u user:password -r hello -d World\n```\n\nTo send credentials in `SETUP` payload, use `--sm simple:\u003cusername\u003e:\u003cpassword\u003e --smmt message/x.rsocket.authentication.v0` as follows.\n\n```\nrsc tcp://localhost:8888 --sm simple:user:password --smmt message/x.rsocket.authentication.v0 -r hello -d World\n```\n\nslightly shorter version\n\n```\nrsc tcp://localhost:8888 --sm simple:user:password --smmt MESSAGE_RSOCKET_AUTHENTICATION -r hello -d World\n```\n\n### [Bearer Token Authentication Type](https://github.com/rsocket/rsocket/blob/master/Extensions/Security/Bearer.md)\n\nTo send token per stream, use `--authBearer \u003ctoken\u003e` option as follows: \n\n```\nrsc tcp://localhost:8888 --authBearer MY_TOKEN -r hello -d World\n```\n\nFor shorter option, `--ab` is also available.\n\nTo send credentials in `SETUP` payload, use `--sm token:\u003ctoken\u003e --smmt message/x.rsocket.authentication.v0` as follows.\n\n```\nrsc tcp://localhost:8888 --sm token:MY_TOKEN --smmt message/x.rsocket.authentication.v0 -r hello -d World\n```\n\nslightly shorter version\n\n```\nrsc tcp://localhost:8888 --sm token:MY_TOKEN --smmt MESSAGE_RSOCKET_AUTHENTICATION -r hello -d World\n```\n\n### Basic Authentication\n\n[Basic Authentication](https://github.com/rsocket/rsocket/issues/272) is not a part of Authentication Extension.\nIt was implemented by Spring Security 5.2 before the spec was standardized.\n\n`rsc` supports Basic Authentication for the backward compatibility with Spring Security 5.2.\n\nTo send credentials per stream, use `--authBasic \u003cusername\u003e:\u003cpassword\u003e` option as follows: \n\n```\nrsc tcp://localhost:8888 --authBasic user:password -r hello -d World\n```\n\nTo send credentials in `SETUP` payload, use `--sm \u003cusername\u003e:\u003cpassword\u003e --smmt message/x.rsocket.authentication.basic.v0` as follows.\n\n```\nrsc tcp://localhost:8888 --sm user:password --smmt message/x.rsocket.authentication.basic.v0 -r hello -d World\n```\n\nslightly shorter version\n\n```\nrsc tcp://localhost:8888 --sm user:password --smmt AUTHENTICATION_BASIC -r hello -d World\n```\n\n## Tracing\n\n`rsc` supports [Tracing (Zipkin) Metadata Extension](https://github.com/rsocket/rsocket/blob/master/Extensions/Tracing-Zipkin.md) since 0.5.0\n\nThe demo application is [here](https://github.com/making/demo-rsocket-tracing).\n\n```\n$ rsc ws://localhost:8080/rsocket -r rr --trace --printB3 --zipkinUrl http://localhost:9411 \nHello World!\nb3=5f035ed7dd21129b105564ef64c90731-105564ef64c90731-d\n```\n\n![image](https://user-images.githubusercontent.com/106908/86621556-5ad6a600-bff9-11ea-9040-8c300d2d8bcd.png)\n\n## TODOs\n\n- [x] Support resuming (0.3.0)\n- [x] Support Composite Metadata (0.3.0)\n- [x] Setup data (0.4.0)\n- [x] Setup Metadata (0.6.0)\n- [x] RSocket Authentication (0.6.0)\n- [x] Request Channel (0.4.0)\n- [x] Input from a file (0.8.0)\n- [x] Input from STDIN (0.4.0)\n- [ ] RSocket Routing Broker\n- [ ] Client side responder\n\n## Build\n\n```\n./mvnw clean package -Pnative -DskipTests\n```\n\nA native binary will be created in `target/classes/rsc-(osx|linux|windows)-x86_64` depending on your OS.\n\nFor linux binary, you can use Docker:\n\n```\n./mvnw spring-boot:build-image  -DskipTests\ndocker run --rm rsc:\u003cversion\u003e --version  \n```\n\n### How to run E2E testing\n\n```\ngit clone https://github.com/making/rsc-e2e\ncd rsc-e2e\nexport RSC_PATH=...\nexport RSC_OIDCISSUERURL=https://uaa.run.pivotal.io/oauth/token # you can change this\nexport RSC_OIDCUSERNAME=...\nexport RSC_OIDCPASSWORD=...\n./mvnw test\n```\n\n## License\nLicensed under the Apache License, Version 2.0.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Frsc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaking%2Frsc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaking%2Frsc/lists"}