-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
add proxy handler "has" for "http2.Http2ServerResponse.socket" and "http2.Http2ServerRequest.socket" #35197
Closed
Closed
add proxy handler "has" for "http2.Http2ServerResponse.socket" and "http2.Http2ServerRequest.socket" #35197
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
dd8afa3
Update compat.js
masx200 fad3ea4
Create test-for-pull-35197.js
masx200 4ef108c
Update compat.js
masx200 33d14d2
Update test-for-pull-35197.js
masx200 f8db9cd
Update test-for-pull-35197.js
masx200 40e47a7
Update test-for-pull-35197.js
masx200 4def244
Update compat.js
masx200 4f0b74a
Update test-for-pull-35197.js
masx200 832d616
Update test-for-pull-35197.js
masx200 68268bf
Update test-for-pull-35197.js
masx200 e634e59
Update compat.js
masx200 ccfccf1
Update test-for-pull-35197.js
masx200 6a67797
Update test-for-pull-35197.js
masx200 362a628
fixup! Update test-for-pull-35197.js
Trott 734fa63
fixup! fixup! Update test-for-pull-35197.js
Trott 19b0951
Update lib/internal/http2/compat.js
masx200 8259db5
Rename test-for-pull-35197.js to test-http2-socket-proxy-handler-for-…
masx200 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,39 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
if (!common.hasCrypto) { | ||
common.skip('missing crypto'); | ||
} | ||
|
||
const fixtures = require('../common/fixtures'); | ||
const assert = require('assert'); | ||
const http2 = require('http2'); | ||
|
||
const serverOptions = { | ||
key: fixtures.readKey('agent1-key.pem'), | ||
cert: fixtures.readKey('agent1-cert.pem') | ||
}; | ||
const server = http2.createSecureServer(serverOptions, common.mustCall( | ||
(req, res) => { | ||
const request = req; | ||
assert.strictEqual(request.socket.encrypted, true); | ||
assert.ok('encrypted' in request.socket); | ||
res.end(); | ||
} | ||
)); | ||
server.listen(common.mustCall(() => { | ||
const port = server.address().port; | ||
const client = http2.connect('https://localhost:' + port, { | ||
ca: fixtures.readKey('agent1-cert.pem'), | ||
rejectUnauthorized: false | ||
}); | ||
const req = client.request({}); | ||
req.on('response', common.mustCall((headers, flags) => { | ||
console.log(headers); | ||
server.close(common.mustCall(() => { | ||
})); | ||
})); | ||
req.on('end', common.mustCall(() => { | ||
client.close(); | ||
})); | ||
req.end(); | ||
})); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional suggestion: The test file only covers one of these conditions, right? Does it make sense to add a test case so that both are covered?