{"action":"created","issue":{"url":"https://api.github.com/repos/zaphoyd/websocketpp/issues/679","repository_url":"https://api.github.com/repos/zaphoyd/websocketpp","labels_url":"https://api.github.com/repos/zaphoyd/websocketpp/issues/679/labels{/name}","comments_url":"https://api.github.com/repos/zaphoyd/websocketpp/issues/679/comments","events_url":"https://api.github.com/repos/zaphoyd/websocketpp/issues/679/events","html_url":"https://github.com/zaphoyd/websocketpp/issues/679","id":273561228,"node_id":"MDU6SXNzdWUyNzM1NjEyMjg=","number":679,"title":"CORS setting","user":{"login":"sasmaster","id":438400,"node_id":"MDQ6VXNlcjQzODQwMA==","avatar_url":"https://avatars2.githubusercontent.com/u/438400?v=4","gravatar_id":"","url":"https://api.github.com/users/sasmaster","html_url":"https://github.com/sasmaster","followers_url":"https://api.github.com/users/sasmaster/followers","following_url":"https://api.github.com/users/sasmaster/following{/other_user}","gists_url":"https://api.github.com/users/sasmaster/gists{/gist_id}","starred_url":"https://api.github.com/users/sasmaster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sasmaster/subscriptions","organizations_url":"https://api.github.com/users/sasmaster/orgs","repos_url":"https://api.github.com/users/sasmaster/repos","events_url":"https://api.github.com/users/sasmaster/events{/privacy}","received_events_url":"https://api.github.com/users/sasmaster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-11-13T20:09:37Z","updated_at":"2018-12-18T13:30:30Z","closed_at":null,"author_association":"NONE","body":"Hi. I am having some issues with Chrome's security when delivering video content in my test env to the\r\nweb browser.Some of the suggestions I get to solve my issue is to reconfigure CORS in the header to allow all origins. That's setting with Access-Control-Allow-Origin: * . Is it something that can be configured on TCP socket header level? If  yes,how?\r\n\r\nThanks.\r\n "},"comment":{"url":"https://api.github.com/repos/zaphoyd/websocketpp/issues/comments/448221398","html_url":"https://github.com/zaphoyd/websocketpp/issues/679#issuecomment-448221398","issue_url":"https://api.github.com/repos/zaphoyd/websocketpp/issues/679","id":448221398,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0ODIyMTM5OA==","user":{"login":"ArosPrince","id":25080989,"node_id":"MDQ6VXNlcjI1MDgwOTg5","avatar_url":"https://avatars2.githubusercontent.com/u/25080989?v=4","gravatar_id":"","url":"https://api.github.com/users/ArosPrince","html_url":"https://github.com/ArosPrince","followers_url":"https://api.github.com/users/ArosPrince/followers","following_url":"https://api.github.com/users/ArosPrince/following{/other_user}","gists_url":"https://api.github.com/users/ArosPrince/gists{/gist_id}","starred_url":"https://api.github.com/users/ArosPrince/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ArosPrince/subscriptions","organizations_url":"https://api.github.com/users/ArosPrince/orgs","repos_url":"https://api.github.com/users/ArosPrince/repos","events_url":"https://api.github.com/users/ArosPrince/events{/privacy}","received_events_url":"https://api.github.com/users/ArosPrince/received_events","type":"User","site_admin":false},"created_at":"2018-12-18T13:30:30Z","updated_at":"2018-12-18T13:30:30Z","author_association":"NONE","body":"I tried to do this, but the validate_handler never gets called. I must be missing something:\r\n```\r\nbool validate(server* s, websocketpp::connection_hdl connection) {\r\n\ts->get_con_from_hdl(connection)->append_header(\"Access-Control-Allow-Origin\", \"*\");\t\r\n\treturn true;\r\n}\r\n\r\nWebsocketServer::WebsocketServer() {\r\n\tm_server.init_asio();\r\n\r\n\tm_server.set_open_handler(bind(&WebsocketServer::on_open, this, ::_1));\r\n\tm_server.set_close_handler(bind(&WebsocketServer::on_close, this, ::_1));\r\n\tm_server.set_message_handler(bind(&WebsocketServer::on_message, this, ::_1, ::_2));\r\n\r\n\tm_server.set_validate_handler(bind(&validate, &m_server, ::_1));\r\n\r\n\tcreateThread([this](const std::string& content) {\r\n\t\tfor (auto it : m_connections) {\r\n\t\t\tm_server.send(it, content, websocketpp::frame::opcode::value::text);\r\n\t\t}\r\n\t});\r\n\r\n\trun(3001);\r\n}\r\n```"}}
{"actor":{"display_login":"ArosPrince"}}