| 72 | } |
| 73 | |
| 74 | do_send_response() |
| 75 | { |
| 76 | string msg = "Eliminate TSCPP"; |
| 77 | |
| 78 | client.response["Server"] = ""; // Deletes the Server header |
| 79 | client.response["X-AMC"] = msg; // New header |
| 80 | client.response["Cache-Control"] = "Private"; // Deletes old CC values, and sets a new one |
| 81 | client.response["X-UUID"] = UniqueUUID(); |
| 82 | client.response["X-tcpinfo"] = client.connection.tcpinfo.Log(); |
| 83 | client.response["X-Cache-Status"] = client.response.cache; |
| 84 | client.response["X-Integer"] = 666; |
| 85 | client.response["X-Data"] = AsString(txn_data[2]); |
| 86 | |
| 87 | client.response["X-ASN"] = client.connection.geo.ASN(); |
| 88 | client.response["X-ASN-Name"] = client.connection.geo.ASNName(); |
| 89 | client.response["X-Country"] = client.connection.geo.Country(); |
| 90 | client.response["X-ISO-Country"] = client.connection.geo.CountryCode(); |
| 91 | |
| 92 | // Setup some connection parameters |
| 93 | client.connection.congestion = "bbr"; |
| 94 | client.connection.dscp = 8; |
| 95 | client.connection.pacing = 100000; |
| 96 | client.connection.mark = 17; |
| 97 | |
| 98 | // Some file operations (note that the paths aren't required here, can just be strings, but it's a good practice) |
| 99 | FilePath(p1, "/tmp/foo"); |
| 100 | FilePath(p2, "/tmp/secret.txt"); |
| 101 | |
| 102 | if (cripts::File::Status(p1).type() == cripts::File::Type::regular) { |
| 103 | client.response["X-Foo-Exists"] = "yes"; |
| 104 | } else { |
| 105 | client.response["X-Foo-Exists"] = "no"; |
| 106 | } |
| 107 | |
| 108 | string secret = cripts::File::Line::Reader(p2); |
| 109 | CDebug("Read secret = {}", secret); |
| 110 | |
| 111 | if (client.response.status == 200) { |
| 112 | client.response.status = 222; |
| 113 | } |
| 114 | |
| 115 | CDebug("Txn count: {}", client.connection.Count()); |
| 116 | } |
| 117 | |
| 118 | do_remap() |
| 119 | { |