ipfs / js-ipfs

IPFS implementation in JavaScript
https://js.ipfs.tech
Other
7.44k stars 1.25k forks source link

Cannot connect to websocket peer #4162

Closed alanshaw closed 1 year ago

alanshaw commented 2 years ago
$ jsipfs swarm connect /dns4/peer.ipfs-elastic-provider-aws.com/tcp/3000/ws/p2p/bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm

    Error: Unexpected server response: 403
        at ClientRequest.<anonymous> (/usr/local/lib/node_modules/ipfs/node_modules/ws/lib/websocket.js:768:7)
        at ClientRequest.emit (node:events:537:28)
        at HTTPParser.parserOnIncomingClient (node:_http_client:642:27)
        at HTTPParser.parserOnHeadersComplete (node:_http_common:117:17)
        at Socket.socketOnData (node:_http_client:505:22)
        at Socket.emit (node:events:537:28)
        at addChunk (node:internal/streams/readable:324:12)
        at readableAddChunk (node:internal/streams/readable:297:9)
        at Readable.push (node:internal/streams/readable:234:10)
        at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
$ jsipfs version --all
js-ipfs version: 0.15.4-965f5a4e00254cee48fca2127d95209deaee09cf
interface-ipfs-core version: ^0.155.2
ipfs-http-client version: 1.0.0
Repo version: 12
System version: arm64/darwin
Node.js version: v16.16.0
Commit: 965f5a4e00254cee48fca2127d95209deaee09cf
achingbrain commented 1 year ago

js-IPFS is in the process of being deprecated, the replacement is Helia - please see the State of IPFS in JS post for a bit of background and the migration guide for how to port your app over.

If the websocket peer is returning a 403 it may be either misconfigured or expects some credentials to be sent?