bassosimone / 2023-12-09-ooni-javascript Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v3.0
License: GNU General Public License v3.0
Testing a website that resolves normally in webbrowser but throws a generic timeout when run with jsconsole
"use strict"
const dsl = require("ooni/dsl")
const time = require("golang/time")
const site = "ycc.org.kh"
const builder = new dsl.Builder()
// implement the DNS lookup part of the DSL
const addresses = builder.dedupAddrs(
builder.dnsLookupUdp(site),
builder.getaddrinfo(site),
)
// implement the 80/tcp pipeline
function port80tcp(addresses) {
const endpoints = builder.makeEndpoints("80", addresses)
const conns = builder.tcpConnect(endpoints)
builder.httpRoundTrip(site, builder.takeN(1, conns))
}
// implement the 443/tcp pipeline
function port443tcp(addresses) {
const endpoints = builder.makeEndpoints("443", addresses)
const conns = builder.tcpConnect(endpoints)
const tlsConns = builder.tlsHandshake(site, ["h2", "http1/1.1"], conns)
builder.httpRoundTrip(site, builder.takeN(1, tlsConns))
}
// implement the 443/udp pipeline
function port443udp(addresses) {
const endpoints = builder.makeEndpoints("443", addresses)
const conns = builder.quicHandshake(site, ["h3"], endpoints)
builder.httpRoundTrip(site, builder.takeN(1, conns))
}
// tie it all together
builder.teeAddrs(addresses, port80tcp, port443tcp, port443udp)
// build and execute the DSL
const root = builder.buildRootNode()
const now = time.now()
const tk = dsl.run(root, now)
//console.log(JSON.stringify(tk))
./jsconsole ycc-testcase.js
2024/01/31 17:16:04 info [#1] DNSLookup[/udp] ycc.org.kh... started
2024/01/31 17:16:04 info [#2] DNSLookup[getaddrinfo] ycc.org.kh... started
2024/01/31 17:16:04 info [#1] DNSLookup[/udp] ycc.org.kh... unknown_failure: missing port in address
2024/01/31 17:16:04 info [#2] DNSLookup[getaddrinfo] ycc.org.kh... ok
2024/01/31 17:16:04 info [#3] QUICHandshake with 199.188.200.84:443 SNI=ycc.org.kh ALPN=[h3]... started
2024/01/31 17:16:04 info [#4] TCPConnect 199.188.200.84:80... started
2024/01/31 17:16:04 info [#5] TCPConnect 199.188.200.84:443... started
2024/01/31 17:16:04 connection doesn't allow setting of send buffer size. Not a *net.UDPConn?. See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.
2024/01/31 17:16:04 info [#5] TCPConnect 199.188.200.84:443... ok
2024/01/31 17:16:04 info [#5] TLSHandshake with 199.188.200.84:443 SNI=ycc.org.kh ALPN=[h2 http1/1.1]... started
2024/01/31 17:16:05 info [#5] TLSHandshake with 199.188.200.84:443 SNI=ycc.org.kh ALPN=[h2 http1/1.1]... ok
2024/01/31 17:16:05 info [#5] HTTPRequest https://ycc.org.kh/ with 199.188.200.84:443/tcp host=ycc.org.kh... started
2024/01/31 17:16:05 info [#3] QUICHandshake with 199.188.200.84:443 SNI=ycc.org.kh ALPN=[h3]... in progress
2024/01/31 17:16:05 info [#4] TCPConnect 199.188.200.84:80... in progress
2024/01/31 17:16:05 info [#4] TCPConnect 199.188.200.84:80... ok
2024/01/31 17:16:05 info [#4] HTTPRequest http://ycc.org.kh/ with 199.188.200.84:80/tcp host=ycc.org.kh... started
2024/01/31 17:16:05 info [#5] HTTPRequest https://ycc.org.kh/ with 199.188.200.84:443/tcp host=ycc.org.kh... in progress
2024/01/31 17:16:05 info [#4] HTTPRequest http://ycc.org.kh/ with 199.188.200.84:80/tcp host=ycc.org.kh... in progress
2024/01/31 17:16:05 info [#4] HTTPRequest http://ycc.org.kh/ with 199.188.200.84:80/tcp host=ycc.org.kh... ok
2024/01/31 17:16:05 info [#4] TCPClose 199.188.200.84:80... started
2024/01/31 17:16:05 info [#4] TCPClose 199.188.200.84:80... ok
2024/01/31 17:16:06 info [#5] HTTPRequest https://ycc.org.kh/ with 199.188.200.84:443/tcp host=ycc.org.kh... ok
2024/01/31 17:16:06 info [#5] TLSClose 199.188.200.84:443... started
2024/01/31 17:16:06 info [#5] TLSClose 199.188.200.84:443... ok
2024/01/31 17:16:09 info [#3] QUICHandshake with 199.188.200.84:443 SNI=ycc.org.kh ALPN=[h3]... generic_timeout_error
https://explorer.ooni.org/m/20240131102419.653752_KH_webconnectivity_c245be556869f466
I need to investigate cause of Tor Snowflake in this network. Here is the full measure https://explorer.ooni.org/m/20240127125543.670583_KH_torsf_03fbde9dfb4c53f3
I think snowflake DSL specification needs to be create before creating a script that runs the experiment .
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.