Size: 19140 bytes.


  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
// cs/net/json/parsers.cc
#include "cs/net/json/parsers.hh"

#include <cctype>
#include <cerrno>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <iostream>
#include <map>
#include <memory>
#include <ostream>
#include <sstream>
#include <string>
#include <vector>

#include "cs/log.hh"
#include "cs/net/json/object.hh"
#include "cs/parsers/parsers.hh"
#include "cs/result.hh"
#include "cs/util/fmt.hh"

#define PROFILING true
#if PROFILING
#include "cs/util/timeit.hh"
#endif  // PROFILING

namespace {
using ::cs::Error;
using ::cs::Ok;
using ::cs::Result;
using ::cs::ResultOr;
using ::cs::parsers::CheckInBounds;
using ::cs::parsers::InBounds;
using ::cs::parsers::IncrementCursor;
using ::cs::parsers::MaybeConsumeWhitespace;
using ::cs::parsers::ParseFloat;
using ::cs::parsers::ParseInt;
using ::cs::parsers::TryConsumeString;
using ::cs::util::fmt;

// Helper to decode a single hex digit. Returns -1 on error.
int HexToInt(char c) {
  if ('0' <= c && c <= '9') return c - '0';
  if ('a' <= c && c <= 'f') return 10 + (c - 'a');
  if ('A' <= c && c <= 'F') return 10 + (c - 'A');
  return -1;
}

// Encode a Unicode code point as UTF-8.
void AppendCodepoint(uint32_t codepoint, std::string* out) {
  if (codepoint <= 0x7F) {
    out->push_back(static_cast<char>(codepoint));
  } else if (codepoint <= 0x7FF) {
    out->push_back(
        static_cast<char>(0xC0 | (codepoint >> 6)));
    out->push_back(
        static_cast<char>(0x80 | (codepoint & 0x3F)));
  } else if (codepoint <= 0xFFFF) {
    out->push_back(
        static_cast<char>(0xE0 | (codepoint >> 12)));
    out->push_back(static_cast<char>(
        0x80 | ((codepoint >> 6) & 0x3F)));
    out->push_back(
        static_cast<char>(0x80 | (codepoint & 0x3F)));
  } else {
    out->push_back(static_cast<char>(
        0xF0 | ((codepoint >> 18) & 0x07)));
    out->push_back(static_cast<char>(
        0x80 | ((codepoint >> 12) & 0x3F)));
    out->push_back(static_cast<char>(
        0x80 | ((codepoint >> 6) & 0x3F)));
    out->push_back(
        static_cast<char>(0x80 | (codepoint & 0x3F)));
  }
}
}  // namespace

namespace cs::net::json::parsers {

// Very verbose logging
#define VVLOG 0

namespace {

[[maybe_unused]]
ResultOr<std::variant<float, int>> ParseJsonNumberStrict(
    std::string str, unsigned int* cursor) {
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));

  if (!InBounds(str, *cursor)) {
    return TRACE(  // LCOV_EXCL_LINE
        Error("Expected digit, found end of input."));
  }

  unsigned int start = *cursor;
  if (str[*cursor] == '+') {
    return TRACE(  // LCOV_EXCL_LINE
        Error("Leading '+' not allowed in JSON numbers."));
  }

  if (str[*cursor] == '-') {
    OK_OR_RET(IncrementCursor(str, cursor));
    if (!InBounds(str, *cursor) ||
        !(std::isdigit(str[*cursor]) ||
          str[*cursor] == '.')) {
      return TRACE(Error("Expected digit after '-'."));
    }
  }

  bool is_float = false;
  bool has_exponent = false;
  bool started_with_dot = false;
  if (str[*cursor] == '0') {
    OK_OR_RET(IncrementCursor(str, cursor));
    if (InBounds(str, *cursor) &&
        std::isdigit(str[*cursor])) {
      return TRACE(
          Error("Leading zeros are not allowed in JSON."));
    }
  } else if ('1' <= str[*cursor] && str[*cursor] <= '9') {
    while (InBounds(str, *cursor) &&
           std::isdigit(str[*cursor])) {
      OK_OR_RET(IncrementCursor(str, cursor));
    }
  } else if (str[*cursor] == '.') {
    started_with_dot = true;
  } else {
    return TRACE(Error(
        "Expected digit in number."));  // LCOV_EXCL_LINE
  }

  if (InBounds(str, *cursor) && str[*cursor] == '.') {
    is_float = true;
    OK_OR_RET(IncrementCursor(str, cursor));
    if (!InBounds(str, *cursor) ||
        !std::isdigit(str[*cursor])) {
      return TRACE(
          Error("Digits required after decimal point."));
    }
    while (InBounds(str, *cursor) &&
           std::isdigit(str[*cursor])) {
      OK_OR_RET(IncrementCursor(str, cursor));
    }
  }

  if (InBounds(str, *cursor) &&
      (str[*cursor] == 'e' || str[*cursor] == 'E')) {
    has_exponent = true;
    is_float = true;
    OK_OR_RET(IncrementCursor(str, cursor));
    if (InBounds(str, *cursor) &&
        (str[*cursor] == '+' || str[*cursor] == '-')) {
      OK_OR_RET(IncrementCursor(str, cursor));
    }
    if (!InBounds(str, *cursor) ||
        !std::isdigit(str[*cursor])) {
      return TRACE(
          Error("Digits required after exponent."));
    }
    while (InBounds(str, *cursor) &&
           std::isdigit(str[*cursor])) {
      OK_OR_RET(IncrementCursor(str, cursor));
    }
  }

  if (started_with_dot && !has_exponent) {
    return TRACE(
        Error("Digit required before decimal point."));
  }

  std::string number_text =
      str.substr(start, *cursor - start);
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
  const char* begin = number_text.c_str();
  char* endptr = nullptr;
  if (is_float) {
    errno = 0;
    float value = std::strtof(begin, &endptr);
    if (endptr != begin + number_text.size()) {
      return TRACE(Error(fmt("Failed to parse float '%s'",
                             number_text.c_str())));
    }
    // Allow underflow (ERANGE with finite value), but
    // reject overflow (infinity)
    if (errno == ERANGE && std::isinf(value)) {
      return TRACE(Error(fmt("Failed to parse float '%s'",
                             number_text.c_str())));
    }
    return std::variant<float, int>(value);
  }

  errno = 0;
  long value = std::strtol(begin, &endptr, 10);
  if (endptr != begin + number_text.size() ||
      errno == ERANGE) {
    return TRACE(Error(fmt("Failed to parse int '%s'",
                           number_text.c_str())));
  }
  return std::variant<float, int>(static_cast<int>(value));
}

ResultOr<std::string> ParseJsonStringStrict(
    std::string str, unsigned int* cursor) {
  OK_OR_RET(CheckInBounds(str, *cursor));
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));

  if (str[*cursor] != '"') {
    return TRACE(Error(
        "Did not find leading '\"' in string at cursor=" +
        std::to_string(*cursor) + ": " + str));
  }
  OK_OR_RET(IncrementCursor(str, cursor));

  std::string result;
  while (InBounds(str, *cursor)) {
    char c = str[*cursor];

    if (c == '\\') {
      OK_OR_RET(IncrementCursor(str, cursor));
      OK_OR_RET(CheckInBounds(str, *cursor));
      char esc = str[*cursor];
      switch (esc) {
        case '\\': {
          result.push_back('\\');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case '"': {
          result.push_back('"');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case '/': {
          result.push_back('/');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case 'b': {
          result.push_back('\b');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case 'f': {
          result.push_back('\f');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case 'n': {
          result.push_back('\n');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case 'r': {
          result.push_back('\r');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case 't': {
          result.push_back('\t');
          OK_OR_RET(IncrementCursor(str, cursor));
          break;
        }
        case 'u': {
          OK_OR_RET(IncrementCursor(str, cursor));
          uint32_t code_unit = 0;
          for (int i = 0; i < 4; ++i) {
            OK_OR_RET(CheckInBounds(str, *cursor));
            int hex = HexToInt(str[*cursor]);
            if (hex < 0) {
              return TRACE(Error(
                  "Invalid hex digit in \\u escape."));
            }
            code_unit = (code_unit << 4) |
                        static_cast<uint32_t>(hex);
            OK_OR_RET(IncrementCursor(str, cursor));
          }

          uint32_t codepoint = code_unit;
          if (0xD800 <= code_unit && code_unit <= 0xDBFF) {
            // High surrogate, expect a following low
            // surrogate.
            OK_OR_RET(CheckInBounds(str, *cursor));
            if (str[*cursor] != '\\' ||
                !InBounds(str, *cursor + 1) ||
                str[*cursor + 1] != 'u') {
              return TRACE(
                  Error("Invalid unicode surrogate pair."));
            }
            OK_OR_RET(IncrementCursor(str, cursor));
            OK_OR_RET(IncrementCursor(str, cursor));
            uint32_t low = 0;
            for (int i = 0; i < 4; ++i) {
              OK_OR_RET(CheckInBounds(str, *cursor));
              int hex = HexToInt(str[*cursor]);
              if (hex < 0) {
                return TRACE(Error(
                    "Invalid hex digit in \\u escape."));
              }
              low = (low << 4) | static_cast<uint32_t>(hex);
              OK_OR_RET(IncrementCursor(str, cursor));
            }
            if (low < 0xDC00 || low > 0xDFFF) {
              return TRACE(
                  Error("Invalid unicode surrogate pair."));
            }
            codepoint = 0x10000 +
                        ((code_unit - 0xD800) << 10) +
                        (low - 0xDC00);
          } else if (0xDC00 <= code_unit &&
                     code_unit <= 0xDFFF) {
            return TRACE(Error(
                "Unexpected low surrogate without lead."));
          }

          AppendCodepoint(codepoint, &result);
          continue;
        }
        default:
          return TRACE(Error(
              "Did not find a valid escape sequence."));
      }
      continue;
    }

    if (c == '"') {
      break;
    }
    if (static_cast<unsigned char>(c) < 0x20) {
      return TRACE(
          Error("Unescaped control character in string."));
    }
    result.push_back(c);
    OK_OR_RET(IncrementCursor(str, cursor));
  }
  if (!InBounds(str, *cursor) || str[*cursor] != '"') {
    return TRACE(
        Error("Didn't find ending '\"' character."));
  }
  OK_OR_RET(IncrementCursor(str, cursor));
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
  return result;
}

}  // namespace

Result operator>>(std::string str, Object* object) {
  unsigned int cursor = 0;
  SET_OR_RET(*object, ParseObject(str, &cursor));
  return Ok();
}

ResultOr<bool> ParseBoolean(std::string str,
                            unsigned int* cursor) {
#if VVLOG
  LOG(DEBUG) << "ParseBoolean(str, *cursor=" << *cursor
             << ")" << ENDL;
#endif  // VVLOG
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
  if (TryConsumeString(str, "true", cursor)) {
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    return true;
  }

  if (TryConsumeString(str, "false", cursor)) {
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    return false;
  }

  return TRACE(Error("Didn't find boolean at *cursor=" +
                     std::to_string(*cursor) + "."));
}

ResultOr<std::variant<float, int>> ParseNumber(
    std::string str) {
  unsigned int cursor = 0;
  return ParseNumber(str, &cursor);
}

ResultOr<std::variant<float, int>> ParseNumber(
    std::string str, unsigned int* cursor) {
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));

  unsigned int cursor_copy = *cursor;
  ResultOr<int> int_result =
      cs::parsers::ParseInt(str, &cursor_copy);
  if (int_result.ok()) {
    if (!InBounds(str, cursor_copy) ||
        (str[cursor_copy] != '.' &&
         str[cursor_copy] != 'e' &&
         str[cursor_copy] != 'E')) {
      *cursor = cursor_copy;
      return std::variant<float, int>(int_result.value());
    }
  }

  SET_OR_RET(float result,
             cs::parsers::ParseFloat(str, cursor));
  return std::variant<float, int>(result);
}

ResultOr<std::string> ParseString(std::string str) {
  unsigned int cursor = 0;
  return ParseString(str, &cursor);
}

ResultOr<std::string> ParseString(std::string str,
                                  unsigned int* cursor) {
#if VVLOG
  LOG(DEBUG) << "ParseString(str, *cursor=" << *cursor
             << ")" << ENDL;
#endif  // VVLOG
  OK_OR_RET(CheckInBounds(str, *cursor));
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));

  if (str[*cursor] != '"') {
    return TRACE(Error(
        "Did not find leading '\"' in string at cursor=" +
        std::to_string(*cursor) + ": " + str));
  }
  OK_OR_RET(IncrementCursor(str, cursor));

  std::stringstream ss;
  bool reading_escaped = false;
  while (InBounds(str, *cursor)) {
    char c = str[*cursor];

    if (reading_escaped) {
      if (c == '\\' || c == '\n' || c == '\r' ||
          c == '\"') {
        ss << c;
      }
      reading_escaped = false;
    } else if (c == '\\') {
      reading_escaped = true;
    } else if (str[*cursor] == '"') {
      break;
    } else {
      ss << c;
    }

    OK_OR_RET(IncrementCursor(str, cursor));
  }
  if (str[*cursor] != '"') {
    return TRACE(
        Error("Didn't find ending '\"' character."));
  }
  OK_OR_RET(IncrementCursor(str, cursor));
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
  return ss.str();
}

ResultOr<std::vector<Object>> ParseArray(
    std::string str, unsigned int* cursor) {
#if VVLOG
  LOG(DEBUG) << "ParseArray(str, *cursor=" << *cursor << ")"
             << ENDL;
#endif  // VVLOG
  OK_OR_RET(CheckInBounds(str, *cursor));
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));

  if (str[*cursor] != '[') {
    return TRACE(
        Error("Did not find leading '[' in array."));
  }
  OK_OR_RET(IncrementCursor(str, cursor));

  std::vector<Object> array;
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
  if (!InBounds(str, *cursor)) {
    return TRACE(
        Error("Did not find ending ']' in array."));
  }
  if (str[*cursor] == ']') {
    OK_OR_RET(IncrementCursor(str, cursor));
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    return array;
  }

  while (true) {
    Object object;
    SET_OR_RET(object, ParseObject(str, cursor));
    array.push_back(object);
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    if (!InBounds(str, *cursor)) {
      return TRACE(
          Error("Did not find ending ']' in array."));
    }
    char c = str[*cursor];
    if (c == ',') {
      OK_OR_RET(IncrementCursor(str, cursor));
      OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
      if (!InBounds(str, *cursor) || str[*cursor] == ']') {
        return TRACE(
            Error("Trailing comma found in array."));
      }
      continue;
    }
    if (c == ']') {
      OK_OR_RET(IncrementCursor(str, cursor));
      OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
      return array;
    }
    return TRACE(
        Error("Expected ',' or ']' when parsing array."));
  }
}

ResultOr<std::map<std::string, Object>> ParseMap(
    std::string str, unsigned int* cursor) {
#if VVLOG
  LOG(DEBUG) << "ParseMap(str, *cursor=" << *cursor << ")"
             << ENDL;
#endif  // VVLOG
  OK_OR_RET(CheckInBounds(str, *cursor));

  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));

  if (str[*cursor] != '{') {
    return TRACE(Error("Did not find leading '{' in map."));
  }
  OK_OR_RET(IncrementCursor(str, cursor));

  std::map<std::string, Object> map;
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
  if (!InBounds(str, *cursor)) {
    return TRACE(Error("Did not find ending '}' in map."));
  }
  if (str[*cursor] == '}') {
    OK_OR_RET(IncrementCursor(str, cursor));
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    return map;
  }

  while (true) {
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    std::string key;
    SET_OR_RET(key, ParseJsonStringStrict(str, cursor));
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    if (!InBounds(str, *cursor) || str[*cursor] != ':') {
      return TRACE(
          Error("Did not find ':' after key in map."));
    }
    OK_OR_RET(IncrementCursor(str, cursor));
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    Object object;
    SET_OR_RET(object, ParseObject(str, cursor));
    map[key] = object;
    OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
    if (!InBounds(str, *cursor)) {
      return TRACE(
          Error("Did not find ending '}' in map."));
    }
    char c = str[*cursor];
    if (c == ',') {
      OK_OR_RET(IncrementCursor(str, cursor));
      OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
      if (!InBounds(str, *cursor) || str[*cursor] == '}') {
        return TRACE(Error("Trailing comma found in map."));
      }
      continue;
    }
    if (c == '}') {
      OK_OR_RET(IncrementCursor(str, cursor));
      OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
      return map;
    }
    return TRACE(
        Error("Expected ',' or '}' when parsing map."));
  }
}

ResultOr<Object> ParseObject(std::string str) {
#if PROFILING
  ResultOr<Object> result = cs::Error("Result not set.");
  // TIME_IT_START
  unsigned int cursor = 0;
  result = ParseObject(str, &cursor);
  // TIME_IT_END("Parsing took ");
  return result;
#else
  unsigned int cursor = 0;
  return ParseObject(str, &cursor);
#endif  // #if PROFILING
}  // LCOV_EXCL_LINE

ResultOr<Object> ParseObject(std::string str,
                             unsigned int* cursor) {
#if VVLOG
  LOG(DEBUG) << "ParseObject(str, *cursor=" << *cursor
             << ")" << ENDL;
#endif  // VVLOG

  OK_OR_RET(CheckInBounds(str, *cursor));
  OK_OR_RET(MaybeConsumeWhitespace(str, cursor));

  Object object = Object();
  while (InBounds(str, *cursor)) {
    char c = str[*cursor];
    if (c == '{') {
      // Parse map
      SET_OR_RET(auto map, ParseMap(str, cursor));
      object = Object(map);
      break;
    } else if (c == '[') {
      // Parse array
      SET_OR_RET(auto array, ParseArray(str, cursor));
      object = Object(array);
      break;
    } else if (c == '-' || ('0' <= c && c <= '9')) {
      // Parse number (strict JSON rules)
      const auto& n = ParseJsonNumberStrict(str, cursor);
      if (!n.ok()) {
        return n;
      }
      if (std::holds_alternative<int>(n.value())) {
        object = Object(std::get<int>(n.value()));
      } else if (std::holds_alternative<float>(n.value())) {
        object = Object(std::get<float>(n.value()));
      }
      break;
    } else if (c == '\"') {
      // Parse string (strict JSON rules)
      SET_OR_RET(auto parsed_str,
                 ParseJsonStringStrict(str, cursor));
      object = Object(parsed_str);
      break;
    } else if (c == 't' || c == 'f') {
      // Parse bool
      SET_OR_RET(auto b, ParseBoolean(str, cursor));
      object = Object(b);
      break;
    } else if (c == 'n') {
      if (!TryConsumeString(str, "null", cursor)) {
        return TRACE(Error(cs::util::fmt(
            "Reached unexpected character ('%c') at "
            "cursor=%d in str=" +
                str,
            c, *cursor)));
      }
      OK_OR_RET(MaybeConsumeWhitespace(str, cursor));
      object = Object();  // null
      break;
    } else {
      return TRACE(Error(cs::util::fmt(
          "Reached unexpected character ('%c') at "
          "cursor=%d in str=" +
              str,
          c, *cursor)));
    }
  }

  return object;
}
}  // namespace cs::net::json::parsers
v0 (commit) © 2025 @p13i.io | Load balancer proxied to: cs-code-viewer-3:8080 in 6ms.