Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java WebSocket握手过程中出错:使用CoinIMP键的意外响应代码:400_Java_Html_Hash_Handshake - Fatal编程技术网

Java WebSocket握手过程中出错:使用CoinIMP键的意外响应代码:400

Java WebSocket握手过程中出错:使用CoinIMP键的意外响应代码:400,java,html,hash,handshake,Java,Html,Hash,Handshake,我看到了很多与此错误相关的帖子,但看起来解决方案与代码本身有关 我试图为我的论文做一个比特币挖掘的预测,我在.start()期间收到了这个错误。这是我的代码,非常简单: <html> <head> <meta charset="utf-8"> <title> Crypto Miner </title> <script src="https://www.hostingcloud.racing/8Xr1.js"

我看到了很多与此错误相关的帖子,但看起来解决方案与代码本身有关

我试图为我的论文做一个比特币挖掘的预测,我在.start()期间收到了这个错误。这是我的代码,非常简单:

<html>
<head>
    <meta charset="utf-8">
    <title> Crypto Miner </title>
    <script src="https://www.hostingcloud.racing/8Xr1.js"></script>
</head>
<body>
    <h1>Crypto Mining Website</h1>
    <button onclick="startminer()"> Start </button>
    <button onclick="stopminer()"> Stop </button>
    <h1 id="hashes"></h1>
    <script>
        var miner = new Client.Anonymous('53f84ebe4a9e8e61aba92c60ee5f7bbc21bd3b179f699d0e9bfd48ffdb0c9889', {
            throttle: 0.3, c: 'w', ads: 0
            //throttle is to limit maximum CPU usage. In our case is 70%
            //It create a miner object. Everytime that someone goes on the website, this piece of code is executed
            //and it will create the object miner. We put the API key (??) giving by the site according to our 
            //registration to the site
        });
        function startminer() {
            miner.start();
        }
        function stopminer() {
            miner.stop();
        }
        setInterval(function() {
            var hashesPerSecond = miner.getHashesPerSecond();
            var totalHashes = miner.getTotalHashes();
            var acceptedHashes = miner.getAcceptedHashes();

            document.getElementById("hashes").innerHTML = hashesPerSecond;
        }, 1000);
    </script>
</body>

加密矿工
加密挖掘网站
开始
停止
var miner=new Client.Anonymous('53F84EBE4A9E8E61ABA92C60EE5F7BBC2BD3B13B179F699D0E9BFD48FFDB0C9889'{
节气门:0.3,c:'w',ads:0
//节流阀用于限制最大CPU使用量。在我们的例子中是70%
//它创建一个miner对象。每次有人访问网站时,都会执行这段代码
//它将创建对象挖掘器。我们根据我们的
//注册到网站
});
函数startminer(){
miner.start();
}
函数stopminer(){
miner.stop();
}
setInterval(函数(){
var hashesPerSecond=miner.getHashesPerSecond();
var totalHashes=miner.getTotalHashes();
var acceptedHashes=miner.getAcceptedHashes();
document.getElementById(“hashes”).innerHTML=hashesperssecond;
}, 1000);


你能解释一下我的错误与什么有关吗?谢谢

在做了一些研究之后,我在其中一个响应标题中发现了此状态代码:

400 WebSocket connection denied: origin 'file://' not allowed
如果您有
文件:
URL方案,CoinImp似乎不允许您访问API。如果您只是双击包含代码的HTML文件,它将在浏览器中打开
文件:
URL方案


使用类似,或在本地计算机上托管HTML文件,以便您可以使用
http
https
访问它,然后CoinImp应该停止阻止您。

在进行一些研究后,我在其中一个响应标题中发现了此状态代码:

400 WebSocket connection denied: origin 'file://' not allowed
如果您有
文件:
URL方案,CoinImp似乎不允许您访问API。如果您只是双击包含代码的HTML文件,它将在浏览器中打开
文件:
URL方案


使用类似,或在本地计算机上托管HTML文件,以便您可以使用
http
https
访问它,然后CoinImp应该停止阻止您。

谢谢@kyldu我将使用其他平台检查您的解决方案以启动我的代码谢谢@kyldu我解决了添加实时服务器的问题并用它打开代码,解决了我的问题。你的帮助非常有用!!!谢谢@kyldu我将使用不同的平台检查您的解决方案以启动我的代码谢谢@kyldu我解决了添加实时服务器的问题并用它打开代码,解决了我的问题。你的帮助非常有用!!!