feat(core): the pages of routers and home routers after Java, measured against Java
Routers and home routers start a web server on port 80 with Java's index, log and routes pages in the project's language (routerPages.ts); the firewall keeps a log per node that outlives a new start; RIP routes carry the telling router's public address. TCP counts sequence numbers and segments in Java's characters, not bytes. RouterWebRun records six stories, with firewalls now built by ScenarioNetwork. Not taken from Java: its router server sometimes never listening (a race in setAktiv), and </titel>. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -24,10 +24,9 @@ import {
|
||||
withSnapshot,
|
||||
type LogLine,
|
||||
type NetworkRuntimeEngine,
|
||||
type WebBrowserLogEntry,
|
||||
} from '../src/index.js';
|
||||
import { expectSameCaptures, watchedEngine, withClientPortText, type JavaFrame, type JavaTables, type SeenFrame } from './javaRun.js';
|
||||
import { clientText, isPolled, POLL_MILLISECONDS, serverText } from './programLines.js';
|
||||
import { browserText, clientText, isPolled, POLL_MILLISECONDS, serverText } from './programLines.js';
|
||||
import { snapshotOf, type Scenario } from './scenario.js';
|
||||
|
||||
const scenarioDirectory = join(dirname(fileURLToPath(import.meta.url)), 'scenarios');
|
||||
@@ -107,21 +106,6 @@ function fileSystemOf(files: [string, string, string][]): VirtualFileSystem {
|
||||
return fileSystem;
|
||||
}
|
||||
|
||||
/** A browser's line as its window took it: a page (with its text only for 200), or "update" for an image. */
|
||||
function browserText(entry: WebBrowserLogEntry): string | undefined {
|
||||
switch (entry.kind) {
|
||||
case 'page':
|
||||
return `page ${entry.statusCode} ${entry.contentType ?? 'null'}${entry.statusCode === 200 ? `\n${entry.body ?? 'null'}` : ''}`;
|
||||
case 'unreachable':
|
||||
return 'page 0 null';
|
||||
case 'image': {
|
||||
// WebBrowser.retrieveImages tells the window of an image that came, or of a status other than 200.
|
||||
const isImage = entry.contentType !== undefined && IMAGE_TYPES.has(entry.contentType.toLowerCase().replace('image/', ''));
|
||||
return entry.statusCode !== 200 || isImage ? 'update' : undefined;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
type Lines = Record<Program, [number, string][]>;
|
||||
|
||||
function javaLines(java: JavaRun): Lines {
|
||||
|
||||
Reference in New Issue
Block a user