Giter Club home page Giter Club logo

wsd's Introduction

wsd

= WebSocket Debugger

Build Status

Terminal Demo

Simple command line utility for debugging WebSocket servers.

Installation

Via go-get:

$ go get github.com/alexanderGugel/wsd

Usage

Command-line usage:

Usage of ./wsd:
  -help
      Display help information about wsd
  -insecureSkipVerify
      Skip TLS certificate verification
  -origin string
      origin of WebSocket client (default "http://localhost/")
  -protocol string
      WebSocket subprotocol
  -url string
      WebSocket server address to connect to (default "ws://localhost:1337/ws")
  -version
      Display version number```

## Why?

Debugging WebSocket servers should be as simple as firing up `cURL`. No need
for dozens of flags, just type `wsd -url=ws://localhost:1337/ws` and you're
connected.

## License

 MIT

wsd's People

Contributors

alexandergugel avatar franciscocpg 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

wsd's Issues

Add support for calling without user input

First off, thank you for the awesome library.

I was wondering if is possible to run this command without user input. Personally, I just want to connect to a websocket, see it's initial message, and then exit.

wsd command not found

I installed go and then I downloaded the go-get using go get github.com/alexanderGugel/wsd but when I run wsd it says command not found.

[WDS] Disconnected! net::ERR_CONNECTION_REFUSED

Bug report

What is the current behavior?
Hi, it took a few months to debug the adb in android gives me problems. I connect the device, accept the debugging authorization and every 20 minutes it disconnects alone, thus popping up again to accept authorization. I debug the apps with livereload, I use the ionic 4 framework. Does anyone know why that happens? Some time ago this was working correctly but I don't know if it's an adb problem or not.

If the current behavior is a bug, please provide the steps to reproduce.

I use the Ionic Framework with version 4, but this happens to me with any version,
1. I connect my device to the PC.

2. I accept the authorization of debugging.

3. I check with the adb devices command that my device recognizes.

4. You recognize it.

5. I launch my application with the command:
ionic cordova run android --livereload --consolelogs.

6. I open the chrome bug to debug my app and see the logs.

7. When 20 minutes have passed, the authorization popup reappears on the device and I get the following error in the DevTools console

Error por consola:

[WDS] Disconnected!
close @ vendor.js:137905
Failed to load resource: net::ERR_CONNECTION_REFUSED
sockjs-node/info?t=1590993683214

What is the expected behavior?

Just months ago or last year this didn't happen. I did not give this error every 20 minutes.

Other relevant information:
webpack version: 3.12.0
Node.js version: v10.16.3 (/usr/local/bin/node)
Operating System: macOS Catalina Versión 10.15.4
Additional tools:

Ionic:

   Ionic CLI                     : 5.4.9 (/usr/local/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 5.1.1
   @angular-devkit/build-angular : 0.803.26
   @angular-devkit/schematics    : 8.3.26
   @angular/cli                  : 8.3.26
   @ionic/angular-toolkit        : 2.2.0

Cordova:

   Cordova CLI       : 9.0.0 ([email protected])
   Cordova Platforms : android 8.1.0
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 4.2.1, (and 13 other plugins)

Utility:

   cordova-res : 0.11.0 (update available: 0.14.0)
   native-run  : 0.2.9 (update available: 1.0.0)

System:

   Android SDK Tools : 26.1.1 (/Users/achacon/Library/Android/sdk)
   ios-deploy        : 1.10.0
   ios-sim           : 8.0.2
   NodeJS            : v10.16.3 (/usr/local/bin/node)
   npm               : 6.13.6
   OS                : macOS Catalina
   Xcode             : Xcode 11.4.1 Build version 11E503a

connection refused

Could you please help with the below issue. I am not able to connect.
Thanks

wsd -url=ws://localhost:1337/ws
connecting to ws://localhost:1337/ws from http://localhost/...
panic: websocket.Dial ws://localhost:1337/ws: dial tcp [::1]:1337: getsockopt: connection refused
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x0 pc=0x4c29b1]

goroutine 1 [running]:
panic(0x73df40, 0xc82000e100)
/usr/lib/golang/src/runtime/panic.go:481 +0x3e6
golang.org/x/net/websocket.(*Conn).Close(0x0, 0x0, 0x0)
/home/Host1/app/src/golang.org/x/net/websocket/websocket.go:236 +0xd1
panic(0x725260, 0xc8200aeb00)
/usr/lib/golang/src/runtime/panic.go:443 +0x4e9
main.main()
/home/Host1/app/src/github.com/alexanderGugel/wsd/main.go:126 +0x8c7

HTTP 400 response causes segfault

Attempting to use WSD with an endpoint that returns an HTTP 400 Bad Request results in a segfault. It probably ought to detect non-OK responses and report them appropriately.

$ curl -s --include  "http://localhost:9080/ws-bi-stream?products=elephant"
HTTP/1.1 400 Bad Request
Server: myapp
Date: Fri, 09 Jun 2017 01:55:05 GMT
Content-Type: text/plain; charset=UTF-8
Content-Length: 51

Invalid request:

'elephant' is not a valid product
$ ./wsd.exe -url "ws://localhost:9080/ws-bi-stream?products=elephant"
connecting to ws://localhost:9080/ws-bi-stream?products=elephant from http://localhost/...
panic: websocket.Dial ws://localhost:9080/ws-bi-stream?products=elephant: bad status
        panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x68 pc=0x5e122d]

goroutine 1 [running]:
golang.org/x/net/websocket.(*Conn).Close(0x0, 0x2, 0x2)
        .../go/src/golang.org/x/net/websocket/websocket.go:236 +0x2d
panic(0x61a940, 0xc0420da340)
        C:/Go/src/runtime/panic.go:489 +0x2dd
main.main()
        .../wsd/main.go:126 +0xbaa

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.