+ void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+ {
+ ConfigTagList tags = ServerInstance->Config->ConfTags("wsorigin");
+ if (tags.first == tags.second)
+ throw ModuleException("You have loaded the websocket module but not configured any allowed origins!");
+
+ OriginList allowedorigins;
+ for (ConfigIter i = tags.first; i != tags.second; ++i)
+ {
+ ConfigTag* tag = i->second;
+
+ // Ensure that we have the <wsorigin:allow> parameter.
+ const std::string allow = tag->getString("allow");
+ if (allow.empty())
+ throw ModuleException("<wsorigin:allow> is a mandatory field, at " + tag->getTagLocation());
+
+ allowedorigins.push_back(allow);
+ }
+
+ ConfigTag* tag = ServerInstance->Config->ConfValue("websocket");
+ hookprov->sendastext = tag->getBool("sendastext", true);
+ hookprov->allowedorigins.swap(allowedorigins);
+ }
+
+ void OnCleanup(ExtensionItem::ExtensibleType type, Extensible* item) CXX11_OVERRIDE