获取id未定义的错误。
如果我使用0.peerjs.com
它就可以了。
这是客户端代码:
var peer = new Peer({
host: 'vchat247.hopto.org',
port: 9000,
path: '/peer/',
debug: 3,
config: {
'iceServers': [
{url: 'stun:stun1.l.google.com:19302'},
{
url: 'turn:numb.viagenie.ca',
credential: 'muazkh', username: 'webrtc@live.com'
}
]
}
});
这是我自己的peer-server
代码:
var fs = require('fs');
var PeerServer = require('peer').PeerServer;
var server = PeerServer({
port: 9000,
path: '/peer/',
ssl: {
key: fs.readFileSync('./myserver.key'),
certificate: fs.readFileSync('./vchat247.hopto.org.crt')
}
});
我做错了什么?
如果我使用此代码:
function randomString(length, chars) {
var result = '';
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)];
return result;
}
var peer = new Peer(randomString(16, '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'), {host: 'vchat247.hopto.org', port: 9000, path: '/peer/'});
答案 0 :(得分:0)
我注意到你发送了一个com.google.api.services.admin.reports.model.Channel
rchannel = new com.google.api.services.admin.reports.model.Channel()
.setId(UUID.randomUUID().toString())
.setType("web_hook")
.setAddress("https://www.domain.com/entry-point/gapi-reports");
//Create an array of all available activity for audit
List<String> applicationNameList = new ArrayList<String>();
//applicationNameList.add("admin");
//applicationNameList.add("calendar");
//applicationNameList.add("drive");
applicationNameList.add("login");
//applicationNameList.add("token");
for (String applicationName: applicationNameList) {
reports.activities().watch("all", applicationName,rchannel).execute();
System.out.println("Hello Successfully registered report service watch for user " + user.getPrimaryEmail() + "application name: " + applicationName);
}
请求,这需要通过ajax或nginx进行wss
以使其正常工作,因为它是一个安全的协议,你这样做吗?此外,你是如何启动peer.js服务器的?它是否托管在同一个框中,您是手动启动它(即:proxy pass
)还是使用init.d或upstart创建了某种服务?
此外,我相信这一点:node server.js
应该是certificate: fs.readFileSync('./vchat247.hopto.org.crt')
(尽管也许它同时接受)
Take a look at this references to help with setting up a proxy pass -