CH-J Server Managerszerverkezelés SSH felett
Menü
Közzétett forrás

CH-J Server Manager

Könyvtárak és fájlok böngészése egy adott alkalmazás kiadásához.

Letöltés forrás ZIP
CH-J / Server Manager 193 fájlok
core-20261011T184039Z-4148710795d0 Hozzáadva: Nem rögzített dátum · Beépített:
Fájlok
checkHttpRuntime.js Hozzáadva: Nem rögzített dátum 2,9 KB · 26 sorok
Fájl letöltése
1"use strict";
2// Integration check against the isolated NGINX QUIC fixture (not a public dependency).
3const assert = require('node:assert/strict');
4const path = require('node:path');
5const { curlRequest, HttpDiagnostics } = require('../src/main/diagnostics/httpDiagnostics');
6const { parseTarget, normalizeOptions } = require('../src/main/diagnostics/common');
7const { runtimePaths, validateRuntime } = require('../src/main/diagnostics/httpRuntime');
8async function main() {
9 const runtime=validateRuntime();const signal=new AbortController().signal;
10 const settings={timeoutMs:1200,caPath:path.resolve(__dirname,'../test/fixtures/diagnostics/ca.pem')};
11 const ipv4=process.env.CHJ_TEST_QUIC_IPV4 || '127.0.0.1', ipv6=process.env.CHJ_TEST_QUIC_IPV6 || '::1';
12 const records=[];
13 for(const address of [ipv4,ipv6]) for(const protocol of ['1.1','2','3']) {
14 const r=await curlRequest(new URL('https://localhost:18443/not-found?token=private'),address,protocol,settings,signal);
15 assert.equal(r.status,'success',JSON.stringify(r));assert.equal(r.negotiated,protocol);assert.equal(r.statusCode,404);assert.equal(r.tls.verified,true);assert.equal(r.headers['set-cookie'],'[redacted]');assert.equal(r.downloadedBytes,11);delete r._body;records.push({address,protocol,...r});
16 }
17 const h2=await curlRequest(new URL('https://localhost:18444/'),ipv4,'2',settings,signal);assert.equal(h2.negotiated,'2');
18 const noQuic=await curlRequest(new URL('https://localhost:18444/'),ipv4,'3',settings,signal);assert.notEqual(noQuic.status,'success');assert.ok(['HTTP3_UDP_TIMEOUT','CONNECTION_REFUSED'].includes(noQuic.code));
19 const badCert=await curlRequest(new URL('https://localhost:18443/'),ipv4,'3',{timeoutMs:1200},signal);assert.equal(badCert.code,'TLS_CERT_INVALID');
20 const wrongHost=await curlRequest(new URL('https://wrong.test:18443/'),ipv4,'3',settings,signal);assert.equal(wrongHost.code,'TLS_CERT_INVALID');
21 const dns={resolve:async()=>[{address:ipv4,family:4}]};const service=new HttpDiagnostics(dns,{caPath:settings.caPath});const resources=service.resources();
22 try {const options=normalizeOptions({target:'https://localhost:18443/redirect?token=private',tools:['http'],protocols:['3']});const result=await service.request(options.target,ipv4,'3',options,signal,resources);assert.equal(result.statusCode,404);assert.equal(result.redirectCount,1);records.push({...result,_body:undefined});}finally{service.dispose(resources);}
23 for(const domain of ['www.ch-j.cz','www.sm.ch-j.de','www.sm.ch-j.eu']){const r=await curlRequest(new URL('https://'+domain+'/'),ipv4,'3',{timeoutMs:5000},signal);assert.equal(r.code,'HTTP3_CONFIRMED',domain+JSON.stringify(r));delete r._body;records.push({domain,...r});}
24 console.log(JSON.stringify({platform:process.platform,arch:process.arch,runtime:runtime.manifest.version,records,negative:{noQuic,badCert,wrongHost}},null,2));
26main().catch(error=>{console.error(error);process.exitCode=1;});
SHA-256a2f7c63addc0883fecefd6537301126333e978861196ae1aed63d6739f573dfe

CH-J Proprietary Software License 1.14 · A forrás a CH-J Proprietary Software License 1.14 alatt található. Rendelkezése nem változtatja meg a licenc feltételeit, és nem ad további jogokat.

Archive SHA-2565a8ea02d06a5643cf2330fe9f54b8767a06c1c59d36527705e536fa9dbca7614