-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This adds a basic sketch of the SDK client library. I mostly mirrored the Python SDK method structure, but would like to diverge from that to make things more ergonomic. Most of the complexity here isn't really in the SDK itself, but rather in the testing framework around it. Making circuit creation requests mockable with Nock required a MITM proxy and some fairly sophisticated request parsing to handle multipart form payloads and the non-determinism of the gzipped tarballs. The circuit creation implementation was also a little tricky in terms of supporting both browsers and node. With these more difficult parts figured out, it shouldn't be too bad to refactor things and clean them up. Note that the docstrings right now are pure fluff, I barely cleaned up what chatgpt output. I wanted to get something there so that I can test/develop the documentation build and then I'll clean these up and write real docs as I refactor the SDK's API. Merges #49
- Loading branch information
Showing
35 changed files
with
73,689 additions
and
2,597 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
.npmrc | ||
.http-mitm-proxy/ | ||
/dist/ | ||
/node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/node_modules/http-mitm-proxy/dist/lib/proxy.js b/node_modules/http-mitm-proxy/dist/lib/proxy.js | ||
index e896595..8623f9f 100644 | ||
--- a/node_modules/http-mitm-proxy/dist/lib/proxy.js | ||
+++ b/node_modules/http-mitm-proxy/dist/lib/proxy.js | ||
@@ -361,7 +361,7 @@ class Proxy { | ||
function makeConnection(port) { | ||
const conn = net_1.default.connect({ | ||
port, | ||
- host: "0.0.0.0", | ||
+ host: "localhost", | ||
allowHalfOpen: true, | ||
}, () => { | ||
const connectKey = `${conn.localPort}:${conn.remotePort}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.