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

Websocket on 1.0.0-beta.52 (TypeError: The header content contains invalid characters) #2754

Closed
gmaijoe opened this issue Apr 29, 2019 · 4 comments
Labels
2.x 2.0 related issues Needs Clarification Requires additional input Stale Has not received enough activity

Comments

@gmaijoe
Copy link

gmaijoe commented Apr 29, 2019

Description

I'm getting the following error when reading infura's websocket endpoint on a new Web3 instance.

`TypeError: The header content contains invalid characters
at validateHeader (_http_outgoing.js:494:11)
at ClientRequest.setHeader (_http_outgoing.js:498:3)
at new ClientRequest (_http_client.js:173:14)
at Object.request (http.js:38:10)
at Object.request (https.js:243:15)
at Object.request (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/node_modules/agent-base/patch-core.js:23:20)
at WebSocketClient.connect (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/node_modules/websocket/lib/WebSocketClient.js:254:56)
at new W3CWebSocket (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/node_modules/websocket/lib/W3CWebSocket.js:62:18)
at ProvidersModuleFactory.createWebsocketProvider (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/node_modules/web3-providers/dist/web3-providers.cjs.js:1262:22)
at new WebsocketProvider$1 (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/node_modules/web3-providers/dist/web3-providers.cjs.js:1328:39)
at Object. (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/Routes/v1/spectrum/util/scanForTransactionETH.js:25:23)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Function._load (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/node_modules/@sentry/node/dist/integrations/console.js:41:47)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object. (/Users/gmaister/Desktop/workspace/Carbon/carbon.js/Routes/v1/spectrum/index.js:20:44)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)

Failed Code Snippet

const networkToUseWS = wss://mainnet.infura.io/ws;
console.log(chalk.magenta('url: ', networkToUseWS));
const web3 = new Web3(new Web3.providers.WebsocketProvider(networkToUseWS));

Versions

  • web3.js: 1.0.0.beta.52
  • nodejs: v8.12.0
@nivida
Copy link
Contributor

nivida commented Apr 29, 2019

Could you create a repository to reproduce this?

@gmaijoe
Copy link
Author

gmaijoe commented Apr 29, 2019

@nivida i added you to our repo (branch is "spectrum")

@nivida
Copy link
Contributor

nivida commented May 23, 2019

Could you add the URL of the repository here?

@nivida nivida added the 2.x 2.0 related issues label Jun 20, 2019
@nivida nivida added Needs Clarification Requires additional input and removed more information needed labels Oct 8, 2019
@github-actions
Copy link

github-actions bot commented Jul 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x 2.0 related issues Needs Clarification Requires additional input Stale Has not received enough activity
Projects
None yet
Development

No branches or pull requests

2 participants