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 Answers1

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.

noob
  • 1
  • 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. – G-Man Says 'Reinstate Monica' Dec 19 '22 at 06: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. – Community Dec 21 '22 at 21:32