aboutsummaryrefslogtreecommitdiff
path: root/client.go
AgeCommit message (Collapse)Author
2026-02-06all: change the host address and revert minimum TLSShulhan
The host kbbi.kemdikbud.go.id has been deactivated and changes to kbbi.kemendikdasmen.go.id. The minimum TLS 1.3 that we set in 0933476ff610 reverted because seems like the website is not under cloudflare but under toffsmcdn.net.
2025-01-12all: use login with two attemptsShulhan
The first attempt detect if we have been blocked by Cloudflare and store the response cookies. The second attempt request again with cookies. Hopefully, this solve the request login being blocked. While at it, add debug code to dump the HTTP request headers on preLogin and Lookup.
2025-01-11all: add options for ClientShulhan
Currently, the options contains Debug field that print the HTML response as text when set to 1.
2025-01-02client: fix connection being blocked by CloudFlareShulhan
I think the admin of kbbi set the HTTPS mode minimal to version 1.3, which cause Go (that use TLS v1.2 by default, but have 1.3 as maximum) being rejected during handshake.
2025-01-02client: use libhttp.Client instead of standard http.ClientShulhan
The libhttp.Client provides much simpler API, where we can define global headers once, like UserAgent and does not need to manually read the response body.
2024-09-08wip: support paging when fetching list of wordsShulhan
2024-09-08all: realign some struct for compact layoutShulhan
Changes, * struct Client realigned from 56 to 40 bytes (-16) * struct Word realigned from 72 to 56 bytes (-16) * anonymous struct in test realigned from 40 to 32 bytes (-8)
2024-04-17all: rename the module and package to "kbbi"Shulhan
Since this module is connecting to KBBI server directly, the module and package name now reflect that, hence we rename them to kbbi. Another reason is we have an internal module named kamusku, in another repository.