sanmiguel / websocket_client

Erlang websocket client (ws and wss supported)
MIT License
44 stars 35 forks source link

To discuss #17

Open inou opened 9 years ago

inou commented 9 years ago

After reading RFC 6455 and reviewing the code I think that we can make it better in couple ways:

Naming

RFC mentions 4 states of connection

Current implementation has

I think we can move to RFC convention, which makes sense: one, from architectural pov; two, it would follow official specification.

Reshape the code base (little bit ;) )

Couple of loose thoughts here:

  1. I'd like to extract codec into separate module
  2. Build in (maybe) reconnecting after receiving HTTP redirect code (3xx)
  3. Maybe separate connection logic from the rest (I'm not sure if it's actually needed atm)

    Add tests

A lot. WIth nicely divided code base that should show lots of bugs, unusual behaviours etc. Adding Proper here would be nice to cover all that.

Thoughts on that?

ps.: + extensions

sanmiguel commented 9 years ago

Completely agree on all counts!