| 234 | |
| 235 | |
| 236 | std::string WebSocket::createKey() |
| 237 | { |
| 238 | Poco::Random rnd; |
| 239 | std::ostringstream ostr; |
| 240 | Poco::Base64Encoder base64(ostr); |
| 241 | Poco::BinaryWriter writer(base64); |
| 242 | writer << rnd.next() << rnd.next() << rnd.next() << rnd.next(); |
| 243 | base64.close(); |
| 244 | return ostr.str(); |
| 245 | } |
| 246 | |
| 247 | |
| 248 | std::string WebSocket::computeAccept(const std::string& key) |