mirror of
https://github.com/embarklabs/embark.git
synced 2025-01-11 22:34:24 +00:00
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));
|
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(',');
|
let cors = corsParts.join(',');
|
||||||
if(blockchainConfig.rpcCorsDomain === 'auto' && cors.length) blockchainConfig.rpcCorsDomain = cors;
|
if(blockchainConfig.rpcCorsDomain === 'auto' && cors.length) blockchainConfig.rpcCorsDomain = cors;
|
||||||
|
@ -20,7 +20,7 @@ class Whisper {
|
|||||||
connectToProvider() {
|
connectToProvider() {
|
||||||
let {host, port} = this.communicationConfig.connection;
|
let {host, port} = this.communicationConfig.connection;
|
||||||
let web3Endpoint = 'ws://' + host + ':' + port;
|
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() {
|
setServiceCheck() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user