Coder Social home page Coder Social logo

vi / websocat Goto Github PK

View Code? Open in Web Editor NEW
6.5K 6.5K 250.0 1.64 MB

Command-line client for WebSockets, like netcat (or curl) for ws:// with advanced socat-like functions

License: MIT License

Rust 97.98% Shell 0.97% Dockerfile 0.19% C 0.87%
cli command-line command-line-tool curl netcat proxy rfc-6455 socat websocket-client websocket-server websockets

websocat's People

Contributors

0mp avatar 0xflotus avatar akostadinov avatar delapouite avatar dependabot[bot] avatar dreamacro avatar herbygillot avatar josegonzalez avatar kianmeng avatar therealprof avatar tibkiss avatar tim77 avatar vi avatar yonas avatar zbinlin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

websocat's Issues

TODO list

For publishing a crate:

  • Stdin to websocket client
  • Abstractions for boxed peer, peer constructor, peer stream
  • TCP connector and listener
  • Websocket server (no ssl)
  • Generic websocket server and client (custom connectors, not just TCP)
  • Replying to WebSocket pings
  • Intermediate structure between command-line strings and actual peers
  • Normal command line interface with a help message and options
  • --text option
  • exec: specifier
  • sh-c: specifier
  • Unidirectional option
  • UNIX and abstract listener and connector

For considering a non-alpha release:

  • Make it singlethreaded and/or provide explicit --threaded option.
  • Correct handling for EOF / socket shutdown
  • More thorough testing
  • Line mode for websockets
  • More useful logging (connection log), -v and --quiet options
  • Option to execute a program on each message, not on each connection.
  • unix seqpacket
  • More lints
  • Delays between reconnects for autoreconnect:
  • De-hardcode buffer size

Further ideas:

  • Non-websocket content redirector
  • SSL listener and connector
  • SCTP
  • Pure Rust SSL support
  • Environment variables like URL for exec:
  • Special JSON powers?
  • Specifying cookies and other HTTP headers.
  • Propagation of "can't accept writes anymore" status.

Please add support for specifying a proxy server

I wanted to use websocat to help me file a bug report in OWASP ZAP, but I can't do that unless I can point it at the ZAP proxy endpoint. This would be useful for other things as well, of course.

How to connect and send request in command line ?

Hi.

Thank for this tool !

I want to launch in command line websocat with a request. I try this :

websocat ws://url:port | echo 'request in JSON'

But not work.

I want to record the result in a file. How i do ?

Sorry for my bad english ...

Thank for your reply and your help.

Please add websocat to HomeBew

First I just want to say thanks for a very handy and great utility. It would be awesome if were available in HomeBrew. Thanks!

Receiver flow control

I'm trying to transfer potentially infinite stream from server to client (browser). When the client does not consume messages fast enough some get lost with the
[WARN websocat::broadcast_reuse_peer] A client's sink is NotReady for start_send
message in websocat stderr. I'd like the websocat in this situation to block until send buffer clears, is it possible? Since TCP already has flow control I'd prefer not to reproduce it on the application level, potentially ruining performance.

(Also, the warning is misleading, should be fatal error IMO since partial stream loss causes either protocol breakage or unintended operation.)

how to add headers?

Hi,
Is it possible to add headers? the documentation doesn't talk about this , and the source code doesn't show a possibility to add it. my websocket server need specific headers to be added like Origin: http://127.0.0.1:9222
thank you

advice on how to redirect udp multicast messages

I am attempting to redirect broadcast UDP messages to javascript webpage clients.

My current approach is as follows as follows:

  1. create a named pipe: mkisofs /tmp/pipe
  2. tail the pipe and forward to websocat: tail -f /tmp/pipe | websocat -t -s 10.0.0.1:1234
  3. run a socat command in an infinite loop to receive messages from my base service that publishes UDP broadcast messages and append them to the pipe like this: while true; do socat -t 0 UDP4-RECVFROM:30000,ip-add-membership=224.223.222.221:127.0.0.1,reuseaddr STDOUT >> /tmp/pipe; done

The issue I'm seeing in my java script webpage is that some messages seem to batch up and arrive in groups while others do not. Messages are JSON arriving once every 4-8 seconds.

Is there a more straight forward approach I should be using to forward the UDP messages? Any ideas on messages seeming to batch?

thanks!

strange behavior in "simple one-argument mode"

I created a websocket server with websocat

 websocat ws-l:127.0.0.1:8888 -

then I opened another websocat as client to connect to this server (using the simple one-argument mode)

printf 'A\nB\nC\n' | websocat ws://127.0.0.1:8888

the expected is : the server should show my messages.
the bug: websocat server will buffer the messages he receives (wireshark shows that the server is receiving the messages and responding correctly with [ACK] ).
if I send a \n to the server then he will print all the old messages that he received before.

two-arguments mode works as expected like this websocat ws://127.0.0.1:8888 -

MAC verification failed during PKCS12 import

Running the latest version from Homebrew (websocat 1.2.0, and socat 1.7.3.2)

In one window, running this command (using test.pkcs12 from the git repo):

$ websocat --pkcs12-der=test.pkcs12 -s 1234
Listening on wss://127.0.0.1:1234/

In another window, running the command:

websocat -t --ws-c-uri=wss://127.0.0.1:1234/ - ws-c:cmd:'socat - ssl:127.0.0.1:1234,verify=0'

Once the connection is established, the "server" window displays the error:

websocat: MAC verification failed during PKCS12 import (wrong password?)

And the "client" window displays the error:

2019/03/01 07:15:13 socat[44652] E SSL_connect(): socket closed by peer
websocat: WebSocketError: WebSocket protocol error
websocat: error running

race condition when piping and closing

There is a race condition when piping to Websocat :
please see this two tests, using Websocat v1.0beta:

here I received the response, good :

$ printf  foo | websocat.exe - ws://127.0.0.1:9222/
{"error":{"code":-32700,"message":"Message must be a valid JSON"}}

here with the same test I did not receive the response :

$ printf  foo | websocat.exe - ws://127.0.0.1:9222/

if I repeat the test 10 times then only 3 or 4 times I receive the response...

fiddling with Wireshark I see that the close opcode flag is sent by Websocat sometimes before receiving the response of the server. if the server take time to answer then Websocat will close the connection before receiving the response.
is it possible to add a delay for the response, and if no response is received in that delay then close. or maybe there is a better solution?

NB:
using this solution I can close when needed and everything works fine because the race condition can never happen, but I wanted to know if it is possible to make it work with simple pipes.
Thank you

User friendliness TODO list

  • single arg mode
  • Text and line mode by default Overhaul line and text mode options.
  • better description of options
  • Proper manual, move reference away from README.
  • Better repository description
  • Introductory examples in README
  • More pre-built versions with SSL support?
  • Github Pages site.
  • Extend examples with sample output and connection command lines
  • Manpage in deb.
  • Rename "specifier" to "address".
  • Warnings visible by default.

Skip SSL/TLS verification?

I was looking for something similar to curl -k option that lets you test a HTTPS endpoint even if you cannot verify the certificate. This is very useful for debug scenarios. Unfortunately I can't seem to find such an option if it exists.

Build failure - smart-default / quote

Fully admit I don't know a lot of Rust so not sure what is wrong. From what I gather quote fails to compile? 45523d8 tries to bump the minimum rust version but I didn't receive any such error.

   Compiling websocket v0.22.0
error[E0432]: unresolved import `quote::quote`
  --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:15:13
   |
15 | use quote::{quote, ToTokens};
   |             ^^^^^ no `quote` in the root

error: cannot find macro `parse_macro_input!` in this scope
  --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:64:17
   |
64 |     let input = parse_macro_input!(input as DeriveInput);
   |                 ^^^^^^^^^^^^^^^^^

error: cannot find macro `quote!` in this scope
  --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:82:14
   |
82 |             (quote! {
   |              ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:100:14
    |
100 |             (quote! {
    |              ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:108:8
    |
108 |     Ok(quote! {
    |        ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:182:13
    |
182 |         Ok((quote! {
    |             ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:168:31
    |
168 |         &syn::Fields::Unit => quote!{},
    |                               ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:132:24
    |
132 |                     Ok(quote! { #field_name : #default_value })
    |                        ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:134:17
    |
134 |                 quote!{
    |                 ^^^^^

error: cannot find macro `quote!` in this scope
   --> /dev/shm/.cargo/registry/src/github.com-1ecc6299db9ec823/smart-default-0.3.0/src/lib.rs:155:17
    |
155 |                 quote! {
    |                 ^^^^^

error: aborting due to 10 previous errors

For more information about this error, try `rustc --explain E0432`.
error: Could not compile `smart-default`.
warning: build failed, waiting for other jobs to finish...
error: build failed

I/O failure when trying to talk to `localhost`

When I try to connect to localhost, I get this error, but when I use 127.0.0.1 instead, everything is fine. I guess websocat can't resolve names or something? curl can talk to the server running on localhost just fine.
Would be cool to have this fixed for ease of use. And thank you for the tool, it does seem to work quite well otherwise 👍

E.g.:

user@hostname $ websocat ws://localhost:8080/ws
websocat: WebSocketError: I/O failure
websocat: error running
user@hostname $ websocat ws://127.0.0.1:8080/ws
# no error
user@hostname $ curl localhost:8080/ws
# no error

version v1.0.0-alpha have problems when parsing the args

Hi,
First I want to thank you for this gem. thank you very much.

The new version v1.0.0-alpha can't parse the args well, the old version 0.4 works well!.
I m using cygwin in windows 7.

using this exemple : https://stackoverflow.com/questions/48912184/wscat-commands-from-script-how-to-pass/48914019#48914019

#!/usr/bin/env bash

runscript() {
  commands=( "first command" "second command" "third command" )

  for command in "${commands[@]}"; do
    echo "Writing command to server" >&2
    echo "$command"
    echo "Reading response from server (assuming exactly one line)" >&2
    read -r line
    echo "Received response: $line" >&2
  done

  # kill websocat, even if the websocket doesn't get closed
  kill "$PPID"
}

export -f runscript

the new version gaves this error

$ ./websocat_nossl_1.0_i686-pc-windows-gnu.exe ws://echo.websocket.org sh-c:'exec bash -c runscript'
'exec' is not recognized as an internal or external command,
operable program or batch file.

using the old version 0.4 everything works fine:

$ ./websocat_nossl_0.4_i686-pc-windows-gnu.exe ws://echo.websocket.org sh-c:'exec bash -c runscript'
INFO:websocat: Connecting to ws://echo.websocket.org/
INFO:websocat: Validating response...
INFO:websocat: Successfully connected
Writing command to server
Reading response from server (assuming exactly one line)
Received response: first command
Writing command to server
Reading response from server (assuming exactly one line)
Received response: second command
Writing command to server
Reading response from server (assuming exactly one line)
Received response: third command
environment: line 9: kill: (1) - No such process
The pipe is being closed. (os error 232)

the version 0.5 too have problems, but seems a different error:

$ ./websocat-0.5.1--windows.exe ws://echo.websocket.org sh-c:'exec bash -c runscript'
websocat: WebSocketError: WebSocket URL failure

thank you.

Don't require second address in order to use flags

Hi, I want to use flags like -H to set headers, without specifying a second WebSocket address, as my application has exactly one address with no proxies.

Can we please provide for more CLI flexibility?

websocat server doesn't reply with Sec-WebSocket-Protocol

As per RFC 6455, if the client includes a Sec-WebSocket-Protocol header, the server must pick one of the available protocols and send back a Sec-WebSocket-Protocol header with the selection made. If it does not send back a Sec-WebSocket-Protocol the client must assume the connection to have failed.

However, (in simple server mode) websocat neither sends back the header by itself nor does the --protocol switch seem to work for some reason.

fails on IEX TOPS

https://iextrading.com/developer/docs/

Their example works in node but not in websocat.

Just so you know.

    WebSockets example that shows a connection to the tops channel and a subscribtion to snap,fb,aig+ topics

// Import socket.io with a connection to a channel (i.e. tops)
const socket = require('socket.io-client')('https://ws-api.iextrading.com/1.0/tops')

// Listen to the channel's messages
socket.on('message', message => console.log(message))

// Connect to the channel
socket.on('connect', () => {

    // Subscribe to topics (i.e. appl,fb,aig+)
      socket.emit('subscribe', 'snap,fb,aig+')

        // Unsubscribe from topics (i.e. aig+)
          socket.emit('unsubscribe', 'aig+')
})

// Disconnect from the channel
socket.on('disconnect', () => console.log('Disconnected.'))

--line option need a better description

in an attempt to understand what --line do, my conclusion was that:
--linemode-retain-newlines only tells to --line don't remove the new lines that you remove secretly, because --line is removing every \n that it found.

the description in the help doesn't tell you it will remove \n. --line short description should contain i think this : \n will be removed and if you want to preserve them use --linemode-retain-newlines.

How to transfer text and binary data in one connection?

Thank you for your great tools. ^^

I want to use the Web SocketAPI. (via TCP)
ex) websocat tcp-l:127.0.0.1:4554 ws://123.456.789.012:8100/api/v1/fileupload

The API works with three commands:

  1. Deliver file information in json format. {"action":"create", "filename":"test.png"} -> text mode
  2. Deliver the actual contents of the file (test,png) -> binary mode
  3. end point of the file. {"action":"stop"} ->text mode

It determines the execution mode and allows only one to be used. (-t or -b)
Can I transfer binary data or text data while connected?
(I am using the Windows environment.)

Multiple Incoming messages

Good work on this project!
I have one question though, does the client keeps the websocket channel open for new incoming messages?

I have a particular scenario where the for one 'outgoing' request, I have two 'incoming' responses from the server. I can see the first response, but not the second ( I see it via the browser). I suspect the channel is closed, but some clarification would be appreciated.

send to websocket

I'm sorry, my cat walked through the keyboard yesterday! Please close the issue! I'm really sorry!

Websocat in servermode eating a CPU core after closing TCP socket

I noticed that with my misbehaving client if I just close the TCP socket on the client side, the loop in block_on will run at maximum speed just spinning:

    frame #36: 0x0000000100028241 websocat`tokio::runtime::current_thread::runtime::Runtime::block_on::h5787e30364afd47d(self=0x00007fff5fbfd788, f=<unavailable>) + 81 at runtime.rs:189
    frame #37: 0x0000000100006f69 websocat`websocat::run::he5b002ccc4cdf93a + 11529 at main.rs:672
    frame #38: 0x0000000100009130 websocat`websocat::main::h64c0053338159ebd + 16 at main.rs:678

Not sure where exactly the bug is but I would expect websocat to handle such a situation.

how to specify server CA, client cert and client key when connecting to wss server?

In order to connect to a websocket service inside a pod in a minikube setup, I need to address the Kubernetes remote API which then demands a client certificate (~/.minikube/client.crt and ~/.minikube/client.key). I also have the server's CA ( ~/.minikube/ca.crt).

curl allows to use these certs with the --cert, --key, and --cacert options.

Does websocat also support specifying the client cert and the server CA when accessing a wss:// URL?

one-argument mode and two-argument mode behave differently

using two-argument mode:
this will send my multi-line payload as 1 message and will retain \n . that is good

$  printf 'A\nB\n' | websocat - ws://echo.websocket.org/
A
B

now look please when using one-argument mode:
this will send 2 messages, but it considers that 1 line is 1 message! and it will remove the \n from every message sent.

$  printf 'A\nB\n' | websocat ws://echo.websocket.org/
A
B

why both examples don't have the same behavior? can one-argument mode have the same behavior like two-argument mode? or am I missing something?

Missing test coverage

  • read debt from web sockets
  • web socket ping/pong
  • text mode
  • ws-c
  • ws custom headers, origin, protocol, ws version
  • multiple overlays
  • unix dgram
  • stdio threaded peer
  • stdio peer
  • some_checks in specparse
  • unidirectional and exit-of-eof modes
  • serve multiple times
  • overlay without serving multiple times
  • autoreconnect
  • read debt handling: too long, too large
  • process peer
  • reuse peer primitive
  • reuse peer broadcast
  • UDP
  • mirror
  • lints
  • msg2line, line2msg
  • file peers

WebSocket Ping doesn't get response

I'm sending a WebSocket Ping to websocat running as server after establishing a connection but I don't receive a Pong:

Here's the text summary from wireshark:

9	10.008700	127.0.0.1	127.0.0.1	WebSocket	58	8090	WebSocket Ping [FIN] 

And this is the packet:

0000   02 00 00 00 45 00 00 36 97 21 40 00 40 06 00 00   ....E..6.!@.@...
0010   7f 00 00 01 7f 00 00 01 d1 f0 1f 9a df 6f 22 79   .............o"y
0020   f1 0b 47 f3 80 18 31 d3 fe 2a 00 00 01 01 08 0a   ..G...1..*......
0030   34 f1 f0 2d 34 f1 c9 3c 89 00                     4..-4..<..

Using websocat as a websocket proxy

Suppose we would want to create a websocket proxy server using websocat.
For instance, client A needs to access ws://somedomain/somewhere. But the websocat to use would be on another computer, acting as a proxy.

What would be the easiest way to do that using websocat? I think it would necessitate another program that would accept the connection, read the target uri and then instantiate websocat with that target uri and a mirror:. Is there a simpler way?

Dependency is not satisfiable: libssl1.1

When installing on Ubuntu 16.04

$ gdebi websocat_1.2.0_amd64.deb 
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... Done
This package is uninstallable
Dependency is not satisfiable: libssl1.1

Requests

Hi,

Thank you for this amazing tool.

I'm unfortunately not familiar with Rust (only C, C++, C#, PHP, JS) so my only option is to make a request to you (instead of coding/submitting it).

There are two features that I'm missing:

  1. I'm trying to get the peer IP when using "exec:binary".
    Would it be possible when I use --exec-args to support a built-in variable (ie: $IP) which would contain the peer IP ?

  2. Using signal instead of closing stdin when using "exec:binary".
    Would it be possible when I use "exec:binary" and the websocket is closed to send SIGHUP (for example) to the binary instead of closing its stdin ?

Regards.

Authentication

Great tool, but I cannot find a way to do authenticated connects with basic auth. Could you please tell me how to archive this or add this option?

I am working in a business environment where no server allows anonymous connections. I am quite surprised nobody missed this before.

Thanks!

Running Arch, and something involving openssl failing? Here's the fix

Are you seeing this?

(lots of success)
.
.
.
error: failed to run custom build command for `openssl v0.9.24`
process didn't exit successfully: `/tmp/cargo-installeT1Fjp/release/build/openssl-52aea9a6aa0ce1e0/build-script-build` (exit code: 101)
--- stderr
thread 'main' panicked at 'Unable to detect OpenSSL version', /home/i336/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-0.9.24/build.rs:16:14
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: failed to compile `websocat v1.1.0`, intermediate artifacts can be found at `/tmp/cargo-installeT1Fjp`

Caused by:
  build failed

Do this, then rerun the cargo command:

export OPENSSL_LIB_DIR="/usr/lib/openssl-1.0"; export OPENSSL_INCLUDE_DIR="/usr/include/openssl-1.0"

"Why?!?"

sfackler/rust-openssl#994

Just saving someone a Google

SUPPORT / REQUEST

Hi,

First thanks for this tool ! I use it in many context (client / serveur / windows / Linux) for tests or POC purpose.

Is there a way for a program run by websocat (--exec) to get HTTP headers (I wish to get cookies) ?
Websocket server display headers with -v -v option, but I can't found a way to get them in my bash script:

websocat -v -v -e --exit-on-eof --text l-ws:0.0.0.0:3009 exec:/WS_user.sh --exec-args websocket
[INFO websocat::lints] Auto-inserting the line mode
...
[INFO websocat::net_peer] Incoming TCP connection from Some(V4(172.17.0.1:43036))
[DEBUG websocat::sessionserve] Underlying connection established
[INFO websocat::sessionserve] Serving 1 ongoing connections
[INFO websocat::ws_server_peer] Incoming connection to websocket: /wsock
[DEBUG websocat::ws_server_peer] Incoming { version: Http11, subject: (Get, AbsolutePath("/wsock")), headers: Headers { Upgrade: websocket
, Connection: upgrade
, Host: wtb_admin:3009
, Cookie: AUTH_TOKEN=80d02638a3cec601e7fbe0cdf6ecc5f4ccb3cce5
, Sec-WebSocket-Version: 13
, Sec-WebSocket-Key: PhjBHwNbV5p4+1dg5agWjA==
, } }
[DEBUG websocat::ws_server_peer] Headers { }
[DEBUG websocat::ws_server_peer] Headers { Sec-WebSocket-Accept: m+ZXqcHuSXeSb3tre38wz+oW1pQ=
, Connection: Upgrade
, Upgrade: websocket
, }
[INFO websocat::ws_server_peer] Upgraded

From client

websocat -H "Cookie: AUTH_TOKEN=80d02638a3cec601e7fbe0cdf6ecc5f4ccb3cce5" -k wss://endpoint/wsock
CONNECT from 172.17.0.1:43036
WEBSOCAT_URI=/wsock
WEBSOCAT_CLIENT=172.17.0.1:43036
SHLVL=2

Script:

echo CONNECT from ${WEBSOCAT_CLIENT}
env

wss has changed

wss shows this message now

$ websocat.exe -t wss://echo.websocket.org
websocat: Unknown address or overlay type of `wss://echo.websocket.org`

it was good with the old version
thank you

slab: error: the optimizations s or z are only accepted on the nightly compiler

 cargo build --release --features=ssl
    Updating registry `https://github.com/rust-lang/crates.io-index`
warning: spurious network error (2 tries remaining): [12/-2] [18] Transferred a partial file (transfer closed with outstanding read data remaining)
warning: spurious network error (1 tries remaining): [12/-2] [56] Failure when receiving data from the peer (Received HTTP code 503 from proxy after CONNECT)
 Downloading readwrite v0.1.1
 Downloading structopt v0.2.14
 Downloading slab_typesafe v0.1.3
 Downloading tokio-reactor v0.1.9
 Downloading websocket v0.22.3
 Downloading tokio-udp v0.1.3
 Downloading tokio-process v0.2.3
 Downloading tokio-tls v0.2.1
 Downloading tokio-tcp v0.1.3
 Downloading tokio-current-thread v0.1.5
 Downloading futures v0.1.25
 Downloading native-tls v0.2.2
 Downloading hyper v0.10.15
 Downloading tokio-io v0.1.12
 Downloading tokio-codec v0.1.1
 Downloading derivative v1.0.2
 Downloading smart-default v0.3.0
 Downloading env_logger v0.6.0
 Downloading log v0.4.6
 Downloading tokio v0.1.16
 Downloading url v1.7.2
 Downloading tokio-stdin-stdout v0.1.5
 Downloading tk-listen v0.2.1
 Downloading bytes v0.4.11
 Downloading cfg-if v0.1.7
 Downloading byteorder v1.3.1
 Downloading iovec v0.1.2
 Downloading clap v2.32.0
 Downloading structopt-derive v0.2.14
 Downloading textwrap v0.10.0
 Downloading bitflags v1.0.4
 Downloading unicode-width v0.1.5
 Downloading heck v0.3.1
 Downloading proc-macro2 v0.4.27
 Downloading quote v0.6.11
 Downloading syn v0.15.27
 Downloading unicode-segmentation v1.2.1
 Downloading unicode-xid v0.1.0
 Downloading slab v0.4.2
 Downloading num_cpus v1.10.0
 Downloading mio v0.6.16
 Downloading crossbeam-utils v0.6.5
 Downloading lazy_static v1.3.0
 Downloading tokio-sync v0.1.3
 Downloading tokio-executor v0.1.6
 Downloading parking_lot v0.7.1
 Downloading libc v0.2.50
 Downloading lazycell v1.2.1
 Downloading net2 v0.2.33
 Downloading fnv v1.0.6
 Downloading parking_lot_core v0.4.0
 Downloading lock_api v0.1.5
 Downloading smallvec v0.6.9
 Downloading rand v0.6.5
 Downloading rand_core v0.4.0
 Downloading rand_isaac v0.1.1
 Downloading rand_jitter v0.1.3
 Downloading rand_chacha v0.1.1
 Downloading rand_os v0.1.3
 Downloading rand_hc v0.1.0
 Downloading rand_xorshift v0.1.1
 Downloading rand_pcg v0.1.2
 Downloading rand_core v0.3.1
 Downloading autocfg v0.1.2
 Downloading rustc_version v0.2.3
 Downloading semver v0.9.0
 Downloading semver-parser v0.7.0
 Downloading scopeguard v0.3.3
 Downloading owning_ref v0.4.0
 Downloading stable_deref_trait v1.1.1
 Downloading sha1 v0.6.0
 Downloading base64 v0.10.1
 Downloading unicase v1.4.2
 Downloading matches v0.1.8
 Downloading percent-encoding v1.0.1
 Downloading idna v0.1.5
 Downloading unicode-normalization v0.1.8
 Downloading unicode-bidi v0.3.4
 Downloading tokio-threadpool v0.1.12
 Downloading tokio-fs v0.1.6
 Downloading tokio-timer v0.2.10
 Downloading crossbeam-queue v0.1.2
 Downloading crossbeam-deque v0.7.1
 Downloading crossbeam-epoch v0.7.1
 Downloading memoffset v0.2.1
 Downloading arrayvec v0.4.10
 Downloading nodrop v0.1.13
 Downloading log v0.3.9
 Downloading httparse v1.3.3
 Downloading typeable v0.1.2
 Downloading time v0.1.42
 Downloading language-tags v0.2.2
 Downloading mime v0.2.6
 Downloading traitobject v0.1.0
 Downloading base64 v0.9.3
 Downloading version_check v0.1.5
 Downloading safemem v0.3.0
 Downloading tokio-uds v0.2.5
 Downloading tokio-file-unix v0.5.1
 Downloading tokio-signal v0.2.7
 Downloading mio-uds v0.6.7
 Downloading openssl-probe v0.1.2
 Downloading openssl-sys v0.9.42
 Downloading openssl v0.10.19
 Downloading pkg-config v0.3.14
 Downloading cc v1.0.30
 Downloading foreign-types v0.3.2
 Downloading foreign-types-shared v0.1.1
 Downloading signal-hook v0.1.8
 Downloading arc-swap v0.3.7
   Compiling nodrop v0.1.13
   Compiling byteorder v1.3.1
   Compiling traitobject v0.1.0
   Compiling lazycell v1.2.1
   Compiling matches v0.1.8
   Compiling safemem v0.3.0
   Compiling openssl v0.10.19
   Compiling lazy_static v1.3.0
   Compiling pkg-config v0.3.14
   Compiling rand_core v0.4.0
   Compiling unicode-xid v0.1.0
   Compiling fnv v1.0.6
   Compiling autocfg v0.1.2
   Compiling smallvec v0.6.9
   Compiling openssl-probe v0.1.2
   Compiling language-tags v0.2.2
   Compiling stable_deref_trait v1.1.1
   Compiling sha1 v0.6.0
   Compiling unicode-width v0.1.5
   Compiling native-tls v0.2.2
   Compiling foreign-types-shared v0.1.1
   Compiling version_check v0.1.5
   Compiling scopeguard v0.3.3
   Compiling arc-swap v0.3.7
   Compiling futures v0.1.25
   Compiling cfg-if v0.1.7
   Compiling libc v0.2.50
   Compiling arrayvec v0.4.10
   Compiling httparse v1.3.3
   Compiling proc-macro2 v0.4.27
   Compiling unicode-segmentation v1.2.1
   Compiling cc v1.0.30
   Compiling memoffset v0.2.1
   Compiling bitflags v1.0.4
   Compiling typeable v0.1.2
   Compiling percent-encoding v1.0.1
   Compiling semver-parser v0.7.0
   Compiling slab v0.4.2
error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `byteorder`.
warning: build failed, waiting for other jobs to finish...
error:error : the optimizations s or z are only accepted on the nightly compilerCould not compile `traitobject`.
warning: build failed, waiting for other jobs to finish...


error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `openssl`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `lazycell`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `nodrop`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `safemem`.
error: the optimizations s or z are only accepted on the nightly compiler
warning: build failed, waiting for other jobs to finish...
error: Could not compile `lazy_static`.
warning: build failed, waiting for other jobs to finish...

error: Could not compile `matches`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `rand_core`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `fnv`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `pkg-config`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `smallvec`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `cc`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `autocfg`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `stable_deref_trait`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `scopeguard`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `arc-swap`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `unicode-width`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `sha1`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `openssl-probe`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `percent-encoding`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `memoffset`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `httparse`.
warning: build failed, waiting for other jobs to finish...
errorerror: the optimizations s or z are only accepted on the nightly compiler: the optimizations s or z are only accepted on the nightly compiler



error: Could not compile `unicode-xid`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `foreign-types-shared`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `native-tls`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `cfg-if`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `language-tags`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `typeable`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `libc`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `version_check`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `slab`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `arrayvec`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `futures`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `bitflags`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `semver-parser`.
warning: build failed, waiting for other jobs to finish...
error: Could not compile `proc-macro2`.
warning: build failed, waiting for other jobs to finish...
error: the optimizations s or z are only accepted on the nightly compiler

error: Could not compile `unicode-segmentation`.

To learn more, run the command again with --verbose.

To capture specific field data

When I use this tool create a websocket, it will keep connection get data continuously,
If I can just request a specific field data, when I get it then disconnect the connection?

for example, I just want to get this in the field {"data":{"count":{"number":}}}

REQUEST: Specify unexpected status code

When the server gives an error, the program indicates:

websocat: WebSocketError: Received unexpected status code

It would be nice if it would specify what the status code actually was, e.g.:

websocat: WebSocketError: Received unexpected status code (404)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.