mirror of https://github.com/embarklabs/embark.git
Added cors for whisper
This commit is contained in:
parent
6a5020402f
commit
51eb5a1f65
|
@ -113,6 +113,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;
|
||||
|
|
|
@ -20,7 +20,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