Skip to content

Instantly share code, notes, and snippets.

@txrev319
Created April 6, 2014 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save txrev319/10002189 to your computer and use it in GitHub Desktop.
Save txrev319/10002189 to your computer and use it in GitHub Desktop.
websocket_handle({text, Msg}, Req, State) ->
try _X = lists:flatten(io_lib:format("~p", [erldn:parse_str(Msg)])) of
_ -> {reply, {text, <<"That's what she said! ", Msg/binary >>}, Req, State}
catch
_ -> {reply, {text, <<"ERROR Parsing", Msg/binary >>}, Req, State}
end;
websocket_handle(_Data, Req, State) ->
{ok, Req, State}.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment