{"action":"created","issue":{"url":"https://api.github.com/repos/warmcat/libwebsockets/issues/697","repository_url":"https://api.github.com/repos/warmcat/libwebsockets","labels_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/697/labels{/name}","comments_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/697/comments","events_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/697/events","html_url":"https://github.com/warmcat/libwebsockets/issues/697","id":192505367,"number":697,"title":"When opcode setted to 0xB?","user":{"login":"kjnoh77","id":15315820,"avatar_url":"https://avatars.githubusercontent.com/u/15315820?v=3","gravatar_id":"","url":"https://api.github.com/users/kjnoh77","html_url":"https://github.com/kjnoh77","followers_url":"https://api.github.com/users/kjnoh77/followers","following_url":"https://api.github.com/users/kjnoh77/following{/other_user}","gists_url":"https://api.github.com/users/kjnoh77/gists{/gist_id}","starred_url":"https://api.github.com/users/kjnoh77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjnoh77/subscriptions","organizations_url":"https://api.github.com/users/kjnoh77/orgs","repos_url":"https://api.github.com/users/kjnoh77/repos","events_url":"https://api.github.com/users/kjnoh77/events{/privacy}","received_events_url":"https://api.github.com/users/kjnoh77/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-30T08:36:39Z","updated_at":"2016-11-30T10:51:46Z","closed_at":"2016-11-30T09:47:52Z","body":"Dear Andy,\r\n\r\nWe are using libwebsocket 1.7.9 for server function.\r\nOur client said to us that they disconnected socket because they received opcode=0x0B.\r\nWe(server) didn't intend to disconnect that socket.\r\nCan you check why server send 0x0B even though we didn't intend to disconnect?\r\n\r\nThanks,\r\noshare."},"comment":{"url":"https://api.github.com/repos/warmcat/libwebsockets/issues/comments/263843607","html_url":"https://github.com/warmcat/libwebsockets/issues/697#issuecomment-263843607","issue_url":"https://api.github.com/repos/warmcat/libwebsockets/issues/697","id":263843607,"user":{"login":"lws-team","id":15154525,"avatar_url":"https://avatars.githubusercontent.com/u/15154525?v=3","gravatar_id":"","url":"https://api.github.com/users/lws-team","html_url":"https://github.com/lws-team","followers_url":"https://api.github.com/users/lws-team/followers","following_url":"https://api.github.com/users/lws-team/following{/other_user}","gists_url":"https://api.github.com/users/lws-team/gists{/gist_id}","starred_url":"https://api.github.com/users/lws-team/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lws-team/subscriptions","organizations_url":"https://api.github.com/users/lws-team/orgs","repos_url":"https://api.github.com/users/lws-team/repos","events_url":"https://api.github.com/users/lws-team/events{/privacy}","received_events_url":"https://api.github.com/users/lws-team/received_events","type":"User","site_admin":false},"created_at":"2016-11-30T10:51:46Z","updated_at":"2016-11-30T10:51:46Z","body":"> Yes, we are using two thread for non secure port and secure port.\r\n\r\nEhhhh don't do that.  I have no idea what that would even look like that even half working.  Read README.coding,md\r\n\r\n```\r\n@section evtloop Libwebsockets is singlethreaded\r\n\r\nLibwebsockets works in a serialized event loop, in a single thread.\r\n\r\nDirectly performing websocket actions from other threads is not allowed. Aside from the internal data being inconsistent in forked() processes, the scope of a wsi (struct websocket) can end at any time during service with the socket closing and the wsi freed.\r\n\r\nWebsocket write activities should only take place in the LWS_CALLBACK_SERVER_WRITEABLE callback as described below.\r\n```\r\n\r\nlws is a singlethreaded, serialized event loop type of deal.  It is deliberately not threadsafe.\r\n\r\nDo not spawn two \"threads\".  One thread, one lws context.\r\n\r\nThere are two ways to come at supporting both SSL or not SSL\r\n\r\n1) Support SSL and not SSL on the same listen port.  Yes you can do it, use LWS_SERVER_OPTION_ALLOW_NON_SSL_ON_SSL_PORT in info.options when creating the context.  That's all.\r\n\r\n2) Support SSL on one port, and non-SSL on another port.  Use LWS_SERVER_OPTION_EXPLICIT_VHOSTS and create 2 x vhost with lws_create_vhost() after you create the context: one listens on one port (eg, 443) and has SSL + certs enabled.  The other listens on another port (eg, 80) and either redirects to the 443 / https port or serves his own, possibly different stuff.\r\n\r\nOne thread.  One context.\r\n\r\n-Andy\r\n"}}
{"actor":{"display_login":"lws-team"}}