File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
examples/js-libp2p-example-transports Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change 11/* eslint-disable no-console */
22
33import fs from 'fs'
4- import https from 'https'
54import { noise } from '@chainsafe/libp2p-noise'
65import { yamux } from '@chainsafe/libp2p-yamux'
76import { tcp } from '@libp2p/tcp'
@@ -11,11 +10,6 @@ import { createLibp2p } from 'libp2p'
1110import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
1211import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
1312
14- const httpServer = https . createServer ( {
15- cert : fs . readFileSync ( './test_certs/cert.pem' ) ,
16- key : fs . readFileSync ( './test_certs/key.pem' )
17- } )
18-
1913const createNode = async ( addresses = [ ] ) => {
2014 if ( ! Array . isArray ( addresses ) ) {
2115 addresses = [ addresses ]
@@ -28,7 +22,10 @@ const createNode = async (addresses = []) => {
2822 transports : [
2923 tcp ( ) ,
3024 webSockets ( {
31- server : httpServer ,
25+ https : {
26+ cert : fs . readFileSync ( './test_certs/cert.pem' ) ,
27+ key : fs . readFileSync ( './test_certs/key.pem' )
28+ } ,
3229 websocket : {
3330 rejectUnauthorized : false
3431 }
Original file line number Diff line number Diff line change 1919 "@chainsafe/libp2p-noise" : " ^16.0.0" ,
2020 "@chainsafe/libp2p-yamux" : " ^7.0.0" ,
2121 "@libp2p/tcp" : " ^10.0.0" ,
22- "@libp2p/websockets" : " ^9.0 .0" ,
22+ "@libp2p/websockets" : " ^9.1 .0" ,
2323 "it-pipe" : " ^3.0.1" ,
2424 "it-to-buffer" : " ^4.0.2" ,
2525 "libp2p" : " ^2.0.0" ,
You can’t perform that action at this time.
0 commit comments