Added cors for whisper
This commit is contained in:
parent
bd9e86cd46
commit
d2b89f88f9
|
@ -117,6 +117,10 @@ Config.prototype._updateBlockchainCors = function(){
|
|||
corsParts.push(utils.buildUrlFromConfig(storageConfig.upload));
|
||||
}
|
||||
}
|
||||
// add whisper cors
|
||||
if(this.communicationConfig && this.communicationConfig.enabled && this.communicationConfig.provider === 'whisper'){
|
||||
corsParts.push('embark');
|
||||
}
|
||||
|
||||
let cors = corsParts.join(',');
|
||||
if(blockchainConfig.rpcCorsDomain === 'auto' && cors.length) blockchainConfig.rpcCorsDomain = cors;
|
||||
|
|
|
@ -22,7 +22,7 @@ class Whisper {
|
|||
connectToProvider() {
|
||||
let {host, port} = this.communicationConfig.connection;
|
||||
let web3Endpoint = 'ws://' + host + ':' + port;
|
||||
this.web3.setProvider(new Web3.providers.WebsocketProvider(web3Endpoint, {headers: {Origin: "http://localhost:8000"}}));
|
||||
this.web3.setProvider(new Web3.providers.WebsocketProvider(web3Endpoint, {headers: {Origin: "embark"}}));
|
||||
}
|
||||
|
||||
setServiceCheck() {
|
||||
|
|
Loading…
Reference in New Issue