- Added
ssl_optionstoWebSockex.Connstruct.- Documentation Pending...
- Fix
pongframe not being a correct return type in spec - Fix bare
pingandpongframes in spec- When there is no associated payload for their frame types
- Fix handling SSL socket closings during the
close_loop - Add types and documentation for processes named with
:viaand:global - Fixed a crash when replying to a closed socket
- Allow
:viaand:globaltuples for named registration. This includes handling forcast/2andsend_frame/2. - Add access to response headers during
handle_connect/2viaConn.resp_headers. - Add
Conn.parse_url/1to handle url to URI conversion. - Allow
Conn.new/2to use a url string instead of aURIstruct. - Automatically add a "/" path to a pathless url.
- The HTTP request will break without a valid path!
- Add
child_specdefinitions for Elixir 1.5+- Or any version that exports
Supervisor.child_spec/2
- Or any version that exports
- Some documentation tweaks
- No longer invoke
handle_disconnectif there is reason to exit from invoking a callback. (e.g. an exception was raised) - Properly handle unexpected SSL socket termination.
- This seems pretty important, but I don't know...
- Return a descriptive error when trying to use
send_frame/2in a callback.
send_frame/2is now synchronous and returns an error when connection is opening or closing.
- Added debug printing for the
:sysmodule. - Rework
Conn.newto accept other protocols. - Added an
InvalidFrameErrorfor frames unrecognized byFrame.encode_frame. - Go through the disconnect cycle when there's an error while with the
{:reply, frame, state}callback response. - Send a close frame with the close code
1011when there is an unexpected error. (Like anExceptionin the middle of a callback) - Add a more specific error when the
:websockexapplication hasn't been started yet. - Added a
:nameoptions for local registration.
- Fix a couple of places where the call stack wasn't being properly tail-call optimized.
- Handle system messages and parent exits while closing the connection.
- The output from
:sys.get_statusdidn't look pretty in:observernow it does! format_status/2now an optional callback.
- SSL frames sent right after connecting will now be handled instead of being left in a dead Task mailbox.
- Fixed some places where
dialyzertold me I had my specs screwed up.
- The parameters for the
handle_connect/2callback have been reversed. The order is now(conn, state).
- Added initial connection timeouts.
(
:socket_connect_timeoutand:socket_recv_timeout)- Can be used as
startorstart_linkoption or as aConn.newoption. :socket_connect_timeout- The timeout for opening a TCP connection.:socket_recv_timeout- The timeout for receiving a HTTP response header.
- Can be used as
startandstart_linkcan now take aConnstruct in place of a url.- Added the ability to handle system messages while opening a connection.
- Added the ability to handle parent exit messages while opening a connection.
- Improve
:sys.get_status,:sys.get_state,:sys.replace_statefunctions.- These are undocumented, but are meant primarly for debugging.
- Ensure
terminate/2callback is called consistently. - Ensure when termination when a parent exit signal is received.
- Add the
system_code_changefunction so that thecode_changecallback is actually used.
- Moved all the
WebSockex.Clientmodule functionality into the baseWebSockexmodule. - Roll
handle_connect_failurefunctionality intohandle_disconnect. - Roll
initfunctionality intohandle_connect
- Roll
initfunctionality intohandle_connecthandle_connectwill be invoked upon establishing any connection, i.e., the intial connection and when reconnecting.- The
initcallback is removed entirely.
- Moved all the
WebSockex.Clientmodule functionality into the baseWebSockexmodule.- Changed the
Applicationmodule toWebSockex.Application.
- Changed the
- Add
WebSockex.startfor non-linked processes. - Add
asyncoption tostartandstart_link. - Roll
handle_connect_failurefunctionality intohandle_disconnect.- The first parameter of
handle_disconnectis now a map with the keys::reason,:conn, and:attempt_number. handle_disconnectnow has another return option for when wanted to reconnect with different URI options or headers:{:reconnect, new_conn, new_state}- Added the
:handle_initial_conn_failureoption to the options forstartandstart_linkthat will allowhandle_disconnectto be called if we can establish a connection during those functions. - Removed
handle_connect_failureentirely.
- The first parameter of
Client.start_linkwill no longer cause the calling process to exit on connection failure and will return a proper error tuple instead.- Change
WebSockex.Conn.RequestErrortoWebSockex.RequestError. - Add
handle_connect_failureto be invoked after initiating a connection fails. Fixes #5
- Rework how disconnects are handled which should improve the
handle_disconnectcallback reliability.