vagrant@vagrant-ubuntu-trusty-64:~/workspace/openvidu-tutorials/openvidu-js-node$ node server.js localhost:4443 MY_SECRET
App listening on port 5000
Logging in | {user, pass}={publisher1, pass}
'publisher1' has logged in
Getting a token | {sessionName}={Session 7}
New session Session 7
Writable {
_writableState:
WritableState {
objectMode: false,
highWaterMark: 16384,
needDrain: false,
ending: false,
ended: false,
finished: false,
decodeStrings: true,
defaultEncoding: 'utf8',
length: 0,
writing: false,
corked: 0,
sync: true,
bufferProcessing: false,
onwrite: [Function],
writecb: null,
writelen: 0,
bufferedRequest: null,
lastBufferedRequest: null,
pendingcb: 0,
prefinished: false,
errorEmitted: false,
bufferedRequestCount: 0,
corkedRequestsFree: CorkedRequest { next: null, entry: null, finish: [Function] } },
writable: true,
domain: null,
_events:
{ response: [Function: handleResponse],
error: [Function: handleRequestError] },
_eventsCount: 2,
_maxListeners: undefined,
_options:
{ protocol: 'https:',
maxRedirects: 21,
maxBodyLength: 10485760,
path: 'https://localhost:4443/api/sessions',
method: 'post',
headers:
{ Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
Authorization: 'Basic T1BFTlZJRFVBUFA6TVlfU0VDUkVU',
'User-Agent': 'axios/0.18.0',
'Content-Length': 129,
host: 'localhost:4443' },
agent: undefined,
auth: undefined,
hostname: '192.168.56.1',
port: '3128',
host: '192.168.56.1',
nativeProtocols: { 'http:': [Object], 'https:': [Object] },
pathname: 'https://localhost:4443/api/sessions' },
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 129,
_requestBodyBuffers:
[ { data: <Buffer 7b 22 6d 65 64 69 61 4d 6f 64 65 22 3a 22 52 4f 55 54 45 44 22 2c 22 72 65 63 6f 72 64 69 6e 67 4d 6f 64 65 22 3a 22 4d 41 4e 55 41 4c 22 2c 22 64 65 ... >,
encoding: undefined } ],
_onNativeResponse: [Function],
_currentRequest:
ClientRequest {
domain: null,
_events:
{ response: [Object],
socket: [Function],
abort: [Function],
aborted: [Function],
error: [Function],
timeout: [Function] },
_eventsCount: 6,
_maxListeners: undefined,
output: [],
outputEncodings: [],
outputCallbacks: [],
outputSize: 0,
writable: true,
_last: true,
upgrading: false,
chunkedEncoding: false,
shouldKeepAlive: false,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedHeader: { 'content-length': false },
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: false,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: null,
alpnProtocol: null,
authorized: false,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 10,
connecting: false,
_hadError: true,
_handle: null,
_parent: null,
_host: null,
_readableState: [Object],
readable: false,
domain: null,
_maxListeners: undefined,
_writableState: [Object],
writable: false,
allowHalfOpen: false,
destroyed: true,
_bytesDispatched: 396,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: null,
_requestCert: true,
_rejectUnauthorized: false,
parser: null,
_httpMessage: [Circular],
read: [Function],
_consuming: true,
_idleNext: null,
_idlePrev: null,
_idleTimeout: -1 },
connection:
TLSSocket {
_tlsOptions: [Object],
_secureEstablished: false,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
_SNICallback: null,
servername: null,
npnProtocol: null,
alpnProtocol: null,
authorized: false,
authorizationError: null,
encrypted: true,
_events: [Object],
_eventsCount: 10,
connecting: false,
_hadError: true,
_handle: null,
_parent: null,
_host: null,
_readableState: [Object],
readable: false,
domain: null,
_maxListeners: undefined,
_writableState: [Object],
writable: false,
allowHalfOpen: false,
destroyed: true,
_bytesDispatched: 396,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: null,
_requestCert: true,
_rejectUnauthorized: false,
parser: null,
_httpMessage: [Circular],
read: [Function],
_consuming: true,
_idleNext: null,
_idlePrev: null,
_idleTimeout: -1 },
_header: 'POST https://localhost:4443/api/sessions HTTP/1.1\r\nAccept: application/json, text/plain, */*\r\nContent-Type: application/json\r\nAuthorization: Basic T1BFTlZJRFVBUFA6TVlfU0VDUkVU\r\nUser-Agent: axios/0.18.0\r\nContent-Length: 129\r\nhost: localhost:4443\r\nConnection: close\r\n\r\n',
_headers:
{ accept: 'application/json, text/plain, */*',
'content-type': 'application/json',
authorization: 'Basic T1BFTlZJRFVBUFA6TVlfU0VDUkVU',
'user-agent': 'axios/0.18.0',
'content-length': 129,
host: 'localhost:4443' },
_headerNames:
{ accept: 'Accept',
'content-type': 'Content-Type',
authorization: 'Authorization',
'user-agent': 'User-Agent',
'content-length': 'Content-Length',
host: 'host' },
_onPendingData: null,
agent:
Agent {
domain: null,
_events: [Object],
_eventsCount: 1,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object],
requests: {},
sockets: [Object],
freeSockets: {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
maxCachedSessions: 100,
_sessionCache: [Object] },
socketPath: undefined,
timeout: undefined,
method: 'POST',
path: 'https://localhost:4443/api/sessions',
_ended: false,
_redirectable: [Circular],
parser: null },
_currentUrl: 'https://192.168.56.1/https://localhost:4443/api/sessions' }
Error: [object Object]
at /home/vagrant/workspace/openvidu-tutorials/openvidu-js-node/node_modules/openvidu-node-client/lib/Session.js:417:28
Please tell me how I should do.
Best regards.