{"action":"created","issue":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/146","labels_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/146/comments","events_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/146/events","html_url":"https://github.com/nickdesaulniers/node-nanomsg/issues/146","id":129156485,"number":146,"title":"Server should not crash on assetion errors from the underlying library","user":{"login":"aliem","id":38418,"avatar_url":"https://avatars.githubusercontent.com/u/38418?v=3","gravatar_id":"","url":"https://api.github.com/users/aliem","html_url":"https://github.com/aliem","followers_url":"https://api.github.com/users/aliem/followers","following_url":"https://api.github.com/users/aliem/following{/other_user}","gists_url":"https://api.github.com/users/aliem/gists{/gist_id}","starred_url":"https://api.github.com/users/aliem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliem/subscriptions","organizations_url":"https://api.github.com/users/aliem/orgs","repos_url":"https://api.github.com/users/aliem/repos","events_url":"https://api.github.com/users/aliem/events{/privacy}","received_events_url":"https://api.github.com/users/aliem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/labels/upstream","name":"upstream","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-01-27T14:15:23Z","updated_at":"2016-01-28T11:03:47Z","closed_at":null,"body":"As the title. I took the ws example changing the protocol to *pub/sub*:\r\n\r\n```\r\nvar ws = new WebSocket('ws://127.0.0.1:7789', [\r\n    'pub.sp.nanomsg.org'\r\n]);\r\n```\r\n\r\nOn the server:\r\n\r\n```\r\nvar pub = nano.socket('pub');\r\npub.on('error', (err) => console.error(err));\r\n...\r\n```\r\n\r\nAfter a ws.send('') from the client:\r\n\r\n```\r\nnode server.js\r\nAssertion failed: 0 (../deps/nanomsg/src/protocols/pubsub/xpub.c:138)\r\n[1]    4925 abort (core dumped)  node server.js\r\n```\r\n\r\nNow I know the client shouldn't send anything over a pub/sub socket but it should never crash the server."},"comment":{"url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/comments/176124639","html_url":"https://github.com/nickdesaulniers/node-nanomsg/issues/146#issuecomment-176124639","issue_url":"https://api.github.com/repos/nickdesaulniers/node-nanomsg/issues/146","id":176124639,"user":{"login":"reqshark","id":937826,"avatar_url":"https://avatars.githubusercontent.com/u/937826?v=3","gravatar_id":"","url":"https://api.github.com/users/reqshark","html_url":"https://github.com/reqshark","followers_url":"https://api.github.com/users/reqshark/followers","following_url":"https://api.github.com/users/reqshark/following{/other_user}","gists_url":"https://api.github.com/users/reqshark/gists{/gist_id}","starred_url":"https://api.github.com/users/reqshark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reqshark/subscriptions","organizations_url":"https://api.github.com/users/reqshark/orgs","repos_url":"https://api.github.com/users/reqshark/repos","events_url":"https://api.github.com/users/reqshark/events{/privacy}","received_events_url":"https://api.github.com/users/reqshark/received_events","type":"User","site_admin":false},"created_at":"2016-01-28T11:03:47Z","updated_at":"2016-01-28T11:03:47Z","body":"@nickdesaulniers as I mentioned to you earlier today at PeninsulaJS (which was awesome :tada: ), I couldn't get ws transport to work with pub/sub after the libnanomsg 0.8-beta update.\r\n\r\n@aliem, I had some success using ws transport with a pub/sub on libnanomsg around 0.7-beta or thereabouts, maybe it was 0.6-beta. If you need ws://pubsub you might want to try those versions using the system flag with npm install\r\n\r\n```bash\r\nnpm install nanomsg --use_system_libnanomsg=true\r\n```\r\n\r\nbtw the transport is still experimental and in development, [nanomsg website says dont use yet](http://nanomsg.org/v0.8/nn_ws.7.html):\r\n> DESCRIPTION\r\n> THIS IS AN EXPERIMENTAL FEATURE. DO NOT USE. THE FUNCTIONALITY IS SUBJECT TO CHANGE WITHOUT PRIOR NOTICE.\r\n\r\n> When calling either nn_bind() or nn_connect(), omitting the port defaults to the RFC 6455 default port 80 for HTTP. Example:\r\n\r\n> ws://127.0.0.1 is equivalent to ws://127.0.0.1:80  \r\n\r\nalso @aliem if you end up trying stuff in the `0.6-beta 0.7-beta` range, please report your results"}}