Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/suppport http proxy #86

Closed
wants to merge 75 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
75 commits
Select commit Hold shift + click to select a range
0691692
fix: 🐛 fix stuck in http request
binsee Feb 2, 2023
f2c4bce
refactor: 🔇 remove log
binsee Feb 2, 2023
57876a1
docs: 📝 update README
binsee Feb 2, 2023
b8361f1
1.5.6
binsee Feb 2, 2023
a8264bd
fix: 🐛 fix throw error
binsee Feb 2, 2023
689dd11
refactor: ♻️ use url.URL
binsee Feb 3, 2023
00fd0ff
refactor: 🚨 fix lint
binsee Feb 3, 2023
2a5e534
1.5.7
binsee Feb 3, 2023
e5104a6
code clean, use emit error instead of destroying destination
huan Feb 6, 2023
545baae
v1.7 for FILEBOX_HTTP_TIMEOUT
huan Feb 6, 2023
f382c3d
add link to issue
huan Feb 6, 2023
db0c1c5
better log
huan Feb 6, 2023
77a9e26
better log
huan Feb 6, 2023
56ea2a5
add unit test for network timeout
huan Feb 6, 2023
c047822
refactor: 🔇 remove log
binsee Feb 6, 2023
0eb3759
update unit test for network timeout
binsee Feb 7, 2023
eb0f363
test: 🚨 fix lint
binsee Feb 7, 2023
a9b4c2e
test: update unit test for network timeout
binsee Feb 7, 2023
ee9cdd3
test: fix unit test for network timeout
binsee Feb 8, 2023
7ecf628
test: fix unit test for network timeout
binsee Feb 8, 2023
5d78dd9
ci: set timeout for tap to 90
binsee Feb 8, 2023
95c4e03
fix: 🐛 fix ERR_STREAM_PREMATURE_CLOSE error
binsee Feb 8, 2023
7e01fa7
test: update unit test for network timeout
binsee Feb 8, 2023
6980bd0
fix: 🐛 fix catch error
binsee Feb 8, 2023
51cf34d
build: update scope of the package
binsee Feb 16, 2023
08a1b64
Merge pull request #31 from binsee/fix/http-stream-bug
binsee Feb 16, 2023
2f1ac65
build: 📌 lock esquery to 1.4.0
binsee Feb 16, 2023
1a9bd03
Merge pull request #33 from juzibot/fix/ci-deps
binsee Feb 16, 2023
2d06272
Merge branch 'main' into change-build
binsee Feb 16, 2023
00a8238
fix: 🐛 fix import deps
binsee Feb 16, 2023
2810297
Merge pull request #34 from juzibot/change-build
binsee Feb 16, 2023
05edb18
ci: 👷 update npm token env
binsee Feb 16, 2023
c702ba2
Merge pull request #35 from juzibot/change-build
binsee Feb 16, 2023
c23d9d7
Revert "build: 📌 lock esquery to 1.4.0"
binsee Feb 16, 2023
d727b9e
1.7.1
binsee Feb 16, 2023
5627547
feat: ✨ support for chunked downloads
binsee Mar 2, 2023
58160b1
test: ✅ add test download in chunks
binsee Mar 2, 2023
b101a96
Merge pull request #36 from juzibot/fix/ci-deps
binsee Mar 2, 2023
2735296
Merge remote-tracking branch 'juzi/main' into feat/download-file-in-c…
binsee Mar 2, 2023
130541e
test: ✅ fix timeout test
binsee Mar 2, 2023
2b86c84
1.7.2
binsee Mar 2, 2023
db4958d
Merge pull request #37 from juzibot/feat/download-file-in-chunks
binsee Mar 2, 2023
305be46
fix: :bug: should close stream when receive error event
su-chang Jul 14, 2023
8f22c97
1.7.3
su-chang Jul 14, 2023
2f44b3d
fix: :bug: reject error
su-chang Jul 14, 2023
cef2738
fix: remove useless blank line
su-chang Jul 14, 2023
c23f1ba
fix: tscongif ci
su-chang Jul 14, 2023
12801c5
Merge pull request #38 from juzibot/fix/close-stream
su-chang Jul 14, 2023
22350c1
fix: 🐛 fix redirect
binsee Oct 27, 2023
4da443b
1.7.4
binsee Oct 27, 2023
da2fcca
Merge pull request #39 from juzibot/fix/redirect
binsee Oct 27, 2023
5b9ff33
fix: 🐛 fix download with chunk
binsee Oct 27, 2023
d59e2eb
docs: 📝 update README
binsee Oct 27, 2023
6a0e10e
refactor: refactor streamToBuffer
binsee Oct 27, 2023
4034632
fix: 🐛 fix res not close in httpHeadHeader
binsee Oct 27, 2023
f3feb79
style: 🚨 fix lint
binsee Oct 27, 2023
7585288
style: 🚨 fix lint
binsee Oct 27, 2023
6776123
style: 🚨 fix lint
binsee Oct 27, 2023
ff024cc
fix: 🐛 fix params
binsee Oct 30, 2023
41a7b94
feat: 💥 split env for http timeout
binsee Oct 30, 2023
6e39f4e
fix: 🐛 fix request timeout and catch error
binsee Oct 30, 2023
a084436
test: ✅ fix test
binsee Oct 30, 2023
286fc6f
chore: ➕ add some dev deps
binsee Oct 30, 2023
5cdab18
feat: Compatible with old env
binsee Oct 30, 2023
69169f0
docs: 📝 update README
binsee Oct 30, 2023
03e685f
1.7.5
binsee Oct 30, 2023
8feb5a2
Merge pull request #40 from juzibot/fix/download-chunk
binsee Oct 30, 2023
03203e7
1.7.6
binsee Oct 30, 2023
0a603a5
feat: 🎸 export misc
hcfw007 Feb 21, 2024
164d85d
1.7.7
hcfw007 Feb 21, 2024
98bcfb8
feat: ✨ support http proxy
binsee Jun 3, 2024
13870f4
1.7.7
binsee Jun 3, 2024
661068f
Merge branch 'main' into feat/suppport-http-proxy
hcfw007 Jun 3, 2024
02303a4
fix: 🐛 env
hcfw007 Jun 3, 2024
5bdb602
1.7.8
hcfw007 Jun 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: 🐛 fix catch error
  • Loading branch information
binsee committed Feb 8, 2023
commit 6980bd069f5c28c66467901b11f0b70ad6183fcf
11 changes: 4 additions & 7 deletions src/misc.ts
Original file line number Diff line number Diff line change
@@ -63,14 +63,11 @@ export async function httpHeadHeader (url: string): Promise<http.IncomingHttpHea
res = response
resolve(res)
})
.once('error', reject)
.on('error', reject)
.setTimeout(HTTP_TIMEOUT, () => {
const e = new Error(`FileBox: Http request timeout (${HTTP_TIMEOUT})!`)
if (res) {
res.emit('error', e)
} else {
req.emit('error', e)
}
req.emit('error', e)
req.destroy()
})
.end()
})
@@ -132,7 +129,7 @@ export async function httpStream (
res = response
resolve(res)
})
.once('error', reject)
.on('error', reject)
.setTimeout(HTTP_TIMEOUT, () => {
const e = new Error(`FileBox: Http request timeout (${HTTP_TIMEOUT})!`)
if (res) {