Deployed fbd1768 with MkDocs version: 1.1.2
This commit is contained in:
parent
ddf992a03c
commit
3d4ecc4501
@ -95,6 +95,10 @@
|
||||
|
||||
<li class="nav-item" data-level="1"><a href="#changelog" class="nav-link">Changelog</a>
|
||||
<ul class="nav flex-column">
|
||||
<li class="nav-item" data-level="2"><a href="#990-2020-07-08" class="nav-link">[9.9.0] - 2020-07-08</a>
|
||||
<ul class="nav flex-column">
|
||||
</ul>
|
||||
</li>
|
||||
<li class="nav-item" data-level="2"><a href="#986-2020-07-06" class="nav-link">[9.8.6] - 2020-07-06</a>
|
||||
<ul class="nav flex-column">
|
||||
</ul>
|
||||
@ -836,6 +840,8 @@
|
||||
|
||||
<h1 id="changelog">Changelog</h1>
|
||||
<p>All changes to this project will be documented in this file.</p>
|
||||
<h2 id="990-2020-07-08">[9.9.0] - 2020-07-08</h2>
|
||||
<p>(socket+websocket+http+redis+snake servers) expose the remote ip and remote port when a new connection is made</p>
|
||||
<h2 id="986-2020-07-06">[9.8.6] - 2020-07-06</h2>
|
||||
<p>(cmake) change the way zlib and openssl are searched</p>
|
||||
<h2 id="985-2020-07-06">[9.8.5] - 2020-07-06</h2>
|
||||
|
@ -262,5 +262,5 @@ webSocket.send("hello world");
|
||||
|
||||
<!--
|
||||
MkDocs version : 1.1.2
|
||||
Build Date UTC : 2020-07-07 17:59:20.821904+00:00
|
||||
Build Date UTC : 2020-07-08 19:14:25.100453+00:00
|
||||
-->
|
||||
|
File diff suppressed because one or more lines are too long
16
sitemap.xml
16
sitemap.xml
@ -1,35 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url><url>
|
||||
<loc>None</loc>
|
||||
<lastmod>2020-07-07</lastmod>
|
||||
<lastmod>2020-07-08</lastmod>
|
||||
<changefreq>daily</changefreq>
|
||||
</url>
|
||||
</urlset>
|
BIN
sitemap.xml.gz
BIN
sitemap.xml.gz
Binary file not shown.
@ -340,28 +340,31 @@ ix::WebSocketServer server(port);
|
||||
|
||||
server.setOnConnectionCallback(
|
||||
[&server](std::shared_ptr<WebSocket> webSocket,
|
||||
std::shared_ptr<ConnectionState> connectionState)
|
||||
std::shared_ptr<ConnectionState> connectionState,
|
||||
std::unique_ptr<ConnectionInfo> connectionInfo)
|
||||
{
|
||||
std::cout << "Remote ip: " << connectionInfo->remoteIp << std::endl;
|
||||
|
||||
webSocket->setOnMessageCallback(
|
||||
[webSocket, connectionState, &server](const ix::WebSocketMessagePtr msg)
|
||||
{
|
||||
if (msg->type == ix::WebSocketMessageType::Open)
|
||||
{
|
||||
std::cerr << "New connection" << std::endl;
|
||||
std::cout << "New connection" << std::endl;
|
||||
|
||||
// A connection state object is available, and has a default id
|
||||
// You can subclass ConnectionState and pass an alternate factory
|
||||
// to override it. It is useful if you want to store custom
|
||||
// attributes per connection (authenticated bool flag, attributes, etc...)
|
||||
std::cerr << "id: " << connectionState->getId() << std::endl;
|
||||
std::cout << "id: " << connectionState->getId() << std::endl;
|
||||
|
||||
// The uri the client did connect to.
|
||||
std::cerr << "Uri: " << msg->openInfo.uri << std::endl;
|
||||
std::cout << "Uri: " << msg->openInfo.uri << std::endl;
|
||||
|
||||
std::cerr << "Headers:" << std::endl;
|
||||
std::cout << "Headers:" << std::endl;
|
||||
for (auto it : msg->openInfo.headers)
|
||||
{
|
||||
std::cerr << it.first << ": " << it.second << std::endl;
|
||||
std::cout << it.first << ": " << it.second << std::endl;
|
||||
}
|
||||
}
|
||||
else if (msg->type == ix::WebSocketMessageType::Message)
|
||||
@ -493,11 +496,14 @@ server.wait();
|
||||
<p>If you want to handle how requests are processed, implement the setOnConnectionCallback callback, which takes an HttpRequestPtr as input, and returns an HttpResponsePtr. You can look at HttpServer::setDefaultConnectionCallback for a slightly more advanced callback example.</p>
|
||||
<pre><code class="cpp">setOnConnectionCallback(
|
||||
[this](HttpRequestPtr request,
|
||||
std::shared_ptr<ConnectionState> /*connectionState*/) -> HttpResponsePtr
|
||||
std::shared_ptr<ConnectionState> /*connectionState*/,
|
||||
std::unique_ptr<ConnectionInfo> connectionInfo) -> HttpResponsePtr
|
||||
{
|
||||
// Build a string for the response
|
||||
std::stringstream ss;
|
||||
ss << request->method
|
||||
ss << connectionInfo->remoteIp
|
||||
<< " "
|
||||
<< request->method
|
||||
<< " "
|
||||
<< request->uri;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user