JuliaWeb / WebSockets.jl

A WebSockets library for Julia
MIT License
158 stars 57 forks source link

Define show(ws::WebSocket) #126

Closed hustf closed 5 years ago

hustf commented 5 years ago

WebSockets currently prints with Julia's general 'show' method. It looks like this:

julia> using WebSockets

julia> import Base.TCPSocket

julia> ws = WebSocket(TCPSocket(), true)
WebSockets.WebSocket{TCPSocket}(TCPSocket(Base.Libc.WindowsRawSocket(Ptr{Void} @0xffffffffffffffff) init, 0 bytes waiting), true, CONNECTED::WebSockets.ReadyState = 1)

I propose this (with colors when possible):

julia> ws = WebSocket(TCPSocket(),true)
WebSocket{TCPSocket}(server, CONNECTED): init

julia> show(ws)
WebSocket(server, CONNECTED)