0

I am running websocat (https://github.com/vi/websocat/) on macOS in server mode for debugging purposes.

I would like to display a timestamp on every incoming message.

However: I am struggling with parameter syntax: how would add that overlay parameter when running in server mode.

My current command line looks like this websocat -s <myip>:<myport>, everything works as expected but I cannot add the timestamp overlay to it

Any idea what I am missing?

1 Answer 1

0

Try this command

websocat - log:timestamp:"wss://echo.websocket.events"

Output

websocat: It is recommended to either set --binary or --text explicitly

READ 59 "1671395858.65176 echo.websocket.events sponsored by Lob.com"

1671395858.65176 echo.websocket.events sponsored by Lob.com

The result is not exactly timestamp. The time is in seconds (nanosecond precision) (Use https://www.epochconverter.com/ to convert back to timestamp)

Also you can try --timestamp-monotonic flag for monotonicity.

2
  • How does this answer the question?  Is “1671395858.65176” a timestamp? … … … … … … Please do not respond in comments; edit your answer to make it clearer and more complete. Commented Dec 19, 2022 at 6:04
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. Commented Dec 21, 2022 at 21:32

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.