Giter VIP home page Giter VIP logo

2023-12-09-ooni-javascript's People

Contributors

bassosimone avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

arky

2023-12-09-ooni-javascript's Issues

Usecase: Website gives a generic timeout

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.