Giter Site home page Giter Site logo

edgemax's People

Contributors

mdlayher avatar vaga avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

edgemax's Issues

EdgeMAX 1.9.1: Websocket EOFs immediately after subscribing

Hey @mdlayher ๐Ÿ‘‹!

I was looking at setting this up in my local network (again), and ran into an issue. I spent about 30 minutes getting familiar enough with the code to debug, but I haven't looked much further.

It looks like the webocket immediately EOFs after the subscribe call is made in client_stats.go, and continues to do so forever! Oddly enough, the pings in the other goroutine work fine, so the session token seems valid - but the websocket seems to take a crap.

I did some digging around the wsCodec.Send call in client_stats.go and added this janky debugging:

	json.NewEncoder(os.Stdout).Encode(sub)

	if err := wsCodec.Send(wsc, sub); err != nil {
		return nil, nil, err
	}

	fmt.Println("waiting..")
	var out interface{}
	fmt.Println(wsCodec.Receive(wsc, &out))
	fmt.Println(out)

This just spits out the payload of the subscribe message, and then immediately tries to receive. What I end up getting is this:

"SUBSCRIBE":[{"name":"export"},{"name":"interfaces"},{"name":"system-stats"}],"UNSUBSCRIBE":[],"SESSION_ID":"nibdnjrpsnrfle65su1jon3r2ob6r7hd"}
waiting..
EOF
<nil>

Matching the payload up, it looks identical to my browser (aside from a different session ID of course), so I'm at a bit of a loss as to why it's flipping out. My only guess is that there might be something wrong in the websocket itself, but I've actually not worked with them much, which is why I figured I'd pause and open this issue.

I'm going to keep digging because I'm curious (and I want to write a blog post about monitoring my home network now that I work remotely, this is a part of that!), but I wanted to see if you were having the same issue.

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.