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

Cannot create custom HttpRequestManager #17

Open
jellelute opened this issue Jul 29, 2019 · 2 comments
Open

Cannot create custom HttpRequestManager #17

jellelute opened this issue Jul 29, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jellelute
Copy link

jellelute commented Jul 29, 2019

Hi,

Thanks for the library. I would like to make use of the HttpRequestManager to be able to reuse the connection. I'm following the exact code example:

const {HttpRequestManager} = require('http2-client');
const httpRequestManager = new HttpRequestManager();

and i'm getting this error:
TypeError: HttpRequestManager is not a constructor
I'm tried using nodejs12 and nodejs10. I use typescript and i'm compiling to ES6, but also tried ES2018. Did you export this class?

@hisco
Copy link
Owner

hisco commented Jul 30, 2019

Hey,

It's not exported by "main" this is why you cannot require it.
You could be using:

const {HttpRequestManager} = require('http2-client/lib/request');

Although it's not recommended using something that is not exported...
Please let me know if it works for you and why you need it.. and I may export it in next version..

@hisco hisco self-assigned this Jul 30, 2019
@hisco hisco added the enhancement New feature or request label Jul 30, 2019
@jellelute
Copy link
Author

Hey hisco,

Thanks, this will work for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants