question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[FEATURE REQUEST] export more events and authentication

See original GitHub issue

Is your feature request related to a problem? Please describe.

1, I tried neffos, it works great, but seems it only focused on Message event. But for app layer, maybe want to collect some information about: connection count, each connection startTime and endTime, last activeTime, and so on.

2, send broadcast PING from server to all client. For mobile network, APP may hibernate at background, which can’t send PING. so need server to send PING to remain the TCP connection and APP alive.

3, able to do authentication when websockt upgrade, like pass the http.Request and return a simple true or false. so the app layer can read url and param from http.Request. for example: http://xxxx/ws/endpoint?uid=aaa&token=bbb

Describe the solution you’d like 1, export some event for each connection, like: CONNECT, CLOSE, ACTIVE(stand for: message, ping, pong) …

2, able to broadcast PING

3, export handler for authentication, which default return true

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:23 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
roytan883commented, Jul 15, 2019

after optimize timingwheel to:

timingwheel.NewTimingWheel(50*time.Millisecond, 100)

CPU and memory looks good now, 10K clients use 240MB on server, and CPU nearly 0%

0reactions
roytan883commented, Jul 13, 2019

@kataras

1, for this PR, only about keepalive feature. what test case should i write? I create it by a new gobwasalive is trying to not impact old code as i’m not familiar with neffos structure right now. And i already add a example at _examples/gobwasalive/main.go. yes, i think some part of it is silly, like the idleTime by NewDialer/NewUpgrader and the global timingwheel. I have not wrote any GO code few months, some part of GO is hazy for me.

But i think the idea about Keepalive is good, i’m happy that you modify this PR or just implement yours which may much better than this one. Most I care is that server will send PING before timeout, it is very important at mobile network to keep my APP socket alive.

2, neffos/gobwas/socket.go return ioutil.ReadAll(s.reader) works fine. I say never got EOF is just about the writing PING and receive EOF error. Normal read return EOF still work (which i use CTRL+C to close client).

3, for deadline, yesterday when i implement two-phases-timeout by modify the gobwas/gorilla socket.go, both got EOF after PING. gorilla is worse, it got EOF right after send PING; gobwas can send a few PING before EOF at neffos.WithTimeout{ WriteTimeout: 20 * time.Second. I guest both related to the writeDeadline reset issue.

reproduce it is simple, just disable

if timeout > 0 { //must set it back to zero, otherwise it will get `EOF` error
        if err := s.UnderlyingConn.SetWriteDeadline(time.Time{}); err != nil {
            log.Fatalf("gobwasalive Socket SetWriteDeadline back, err: %v", err)
        }
    }

and add some Printf in gobwasalive/socket.go ReadData, then run _examples/gobwasalive/main.go. you will find that client will disconnect at 20s by EOF.

Read more comments on GitHub >

github_iconTop Results From Across the Web

MS Authenticator app feature request: export to file / import ...
MS Authenticator app feature request: export to file / import from file ... that file can then be imported by another phone in...
Read more >
Request profile in segment event export - Geographic regions
Request profile in segment event export. The export can be requested for specific segment or based on event dates and the data can...
Read more >
Export user events | Guides - ReachFive Documentation
You can export user events using the ReachFive Console. This export allows you to retrieve all events or just the latest events. Exports...
Read more >
Topics tagged feature-request - Auth0 Community
Topics tagged feature-request. ... Configuration for preventing unverified authentication ... Expose more than the name of the role in the context event.
Read more >
Schedule data exports | Firestore - Firebase - Google
Enable billing for your Google Cloud project. Only Google Cloud projects with billing enabled can use the export and import feature. Note: Firebase...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found