How to make go-ipfs use ws-star for punsub

go-ipfs not support wss

so i can’t use
/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star

i wanna make js-ipfs and go-ipfs can join same pubsub topic

anyone any other address can do this
or how can make go-ipfs support it

Hi, I believe it work if you connect js-ipfs to go-ipfs daemon directly.
At least I’m able to make them talk together. (I keep struggling with node running from go code though)

You need to add an address with websocket support in your daemon configuration.
This is the configuration I use for the daemon.
{
“API”: {
“HTTPHeaders”: {}
},
“Addresses”: {
“API”: “/ip4/127.0.0.1/tcp/5001”,
“Announce”: [],
“Gateway”: “/ip4/127.0.0.1/tcp/8080”,
“NoAnnounce”: [],
“Swarm”: [
“/ip4/0.0.0.0/tcp/4001”,
“/ip4/127.0.0.1/tcp/4003/ws”,
“/ip6/::/tcp/4001”
]
},
“Bootstrap”: [
“/dnsaddr/bootstrap.libp2p.io/ipfs/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN”,
“/dnsaddr/bootstrap.libp2p.io/ipfs/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa”,
“/dnsaddr/bootstrap.libp2p.io/ipfs/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb”,
“/dnsaddr/bootstrap.libp2p.io/ipfs/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt”,
“/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ”,
“/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM”,
“/ip4/128.199.219.111/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu”,
“/ip4/104.236.76.40/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64”,
“/ip4/178.62.158.247/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd”,
“/ip6/2604:a880:1:20::203:d001/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM”,
“/ip6/2400:6180:0:d0::151:6001/tcp/4001/ipfs/QmSoLSafTMBsPKadTEgaXctDQVcqN88CNLHXMkTNwMKPnu”,
“/ip6/2604:a880:800:10::4a:5001/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64”,
“/ip6/2a03:b0c0:0:1010::23:1001/tcp/4001/ipfs/QmSoLer265NRgSp2LA3dPaeykiS1J6DifTC88f5uVQKNAd”
],
“Datastore”: {
“BloomFilterSize”: 0,
“GCPeriod”: “1h”,
“HashOnRead”: false,
“Spec”: {
“mounts”: [
{
“child”: {
“path”: “blocks”,
“shardFunc”: “/repo/flatfs/shard/v1/next-to-last/2”,
“sync”: true,
“type”: “flatfs”
},
“mountpoint”: “/blocks”,
“prefix”: “flatfs.datastore”,
“type”: “measure”
},
{
“child”: {
“compression”: “none”,
“path”: “datastore”,
“type”: “levelds”
},
“mountpoint”: “/”,
“prefix”: “leveldb.datastore”,
“type”: “measure”
}
],
“type”: “mount”
},
“StorageGCWatermark”: 90,
“StorageMax”: “10GB”
},
“Discovery”: {
“MDNS”: {
“Enabled”: true,
“Interval”: 10
}
},
“Experimental”: {
“FilestoreEnabled”: false,
“Libp2pStreamMounting”: false,
“P2pHttpProxy”: false,
“PreferTLS”: false,
“QUIC”: false,
“ShardingEnabled”: false,
“UrlstoreEnabled”: false
},
“Gateway”: {
“APICommands”: [],
“HTTPHeaders”: {
“Access-Control-Allow-Headers”: [
“X-Requested-With”,
“Range”,
“User-Agent”
],
“Access-Control-Allow-Methods”: [
“GET”
],
“Access-Control-Allow-Origin”: [
“*”
]
},
“NoFetch”: false,
“PathPrefixes”: [],
“RootRedirect”: “”,
“Writable”: false
},
“Identity”: {
“PeerID”: “Qmat51xLr51cLfFVYzHbT1miVBeMxvJzHs1uwUBcLNBE8e”
},
“Ipns”: {
“RecordLifetime”: “”,
“RepublishPeriod”: “”,
“ResolveCacheSize”: 128
},
“Mounts”: {
“FuseAllowOther”: false,
“IPFS”: “/ipfs”,
“IPNS”: “/ipns”
},
“Pubsub”: {
“DisableSigning”: false,
“Router”: “”,
“StrictSignatureVerification”: false
},
“Reprovider”: {
“Interval”: “12h”,
“Strategy”: “all”
},
“Routing”: {
“Type”: “dht”
},
“Swarm”: {
“AddrFilters”: null,
“ConnMgr”: {
“GracePeriod”: “20s”,
“HighWater”: 900,
“LowWater”: 600,
“Type”: “basic”
},
“DisableBandwidthMetrics”: false,
“DisableNatPortMap”: false,
“DisableRelay”: false,
“EnableAutoNATService”: false,
“EnableAutoRelay”: false,
“EnableRelayHop”: false
}
}

Note “/ip4/127.0.0.1/tcp/4003/ws” in swarm list.
Also I start the daemon with --enable-pubsub-experiment

JS Side,
I configure the node and perform node.swarm.connect(/ip4/…/4003/ws/p2p/QmPeer)

I can then receive, pubsub messages from go to js and ‘vice-versa’.
A probably important thing to note too is that I just checked on localhost.

in real use case, they will not on same localhost
and every client is not know other peer address

so directly connect is not good choose for me