2017-11-20 11 views
1

Ich habe eine schwierige Zeit, eine authentifizierte Anfrage an Verbündeten/TradeKing Zitat Strom.Berechtigungsproblem mit Knoten js Anfrage

Ich benutze Node JS, um die Anfrage zu stellen. Ich habe mehrere Methoden versucht, um die Anfrage zu stellen, aber für die Zwecke dieser Frage werde ich mit dem Beispiel von ihrem website, unter Verwendung der oauth modul e bleiben. Was ich tun möchte, ist console.log (Daten), und ich erwarte eine stream of stock quotes. Stattdessen habe ich eine 401 nicht autorisierte zurückgegeben. Kann mir jemand eine Richtung weisen, um das Problem besser zu beheben oder eine Korrektur anzubieten? Hier ist mein Code, und die Server-Antwort:

/// /// CODE

var OAuth = require('oauth').OAuth; 
var credentials = { 
    consumer_key: "xxxxxxxxxxx", 
    consumer_secret: "xxxxxxxxxxx", 
    access_token: "xxxxxxxxxxx", 
    access_secret: "xxxxxxxxxxx" 
}; 
var oa = new OAuth(null, null, credentials.consumer_key, credentials.consumer_secret, "1.0", null, "HMAC-SHA1"); 
var request = oa.get("https://stream.tradeking.com/v1/market/quotes?symbols=AAPL", 
credentials.access_token, 
credentials.access_secret); 
request.on('response', function (response) { 
    response.setEncoding('utf8'); 
     console.log(response.statusCode) 
     console.log(response) 
}); 
request.end(); 

/// /// RESPONSE

IncomingMessage { 
_readableState: 
ReadableState { 
objectMode: false, 
highWaterMark: 16384, 
buffer: BufferList { head: null, tail: null, length: 0 }, 
length: 0, 
pipes: null, 
pipesCount: 0, 
flowing: null, 
ended: false, 
endEmitted: false, 
reading: false, 
sync: true, 
needReadable: false, 
emittedReadable: false, 
readableListening: false, 
resumeScheduled: false, 
defaultEncoding: 'utf8', 
ranOut: false, 
awaitDrain: 0, 
readingMore: true, 
decoder: 
StringDecoder { 
encoding: 'utf8', 
fillLast: [Function: utf8FillLast], 
lastNeed: 0, 
lastTotal: 0, 
lastChar: <Buffer 00 00 00 00> }, 
encoding: 'utf8' }, 
readable: true, 
domain: null, 
_events: { end: [Function: responseOnEnd] }, 
_eventsCount: 1, 
_maxListeners: undefined, 
socket: 
TLSSocket { 
_tlsOptions: 
{ pipe: null, 
secureContext: [Object], 
isServer: false, 
requestCert: true, 
rejectUnauthorized: true, 
session: undefined, 
NPNProtocols: undefined, 
ALPNProtocols: undefined, 
requestOCSP: undefined }, 
_secureEstablished: true, 
_securePending: false, 
_newSessionPending: false, 
_controlReleased: true, 
_SNICallback: null, 
servername: null, 
npnProtocol: false, 
alpnProtocol: false, 
authorized: true, 
authorizationError: null, 
encrypted: true, 
_events: 
{ close: [Object], 
end: [Object], 
finish: [Function: onSocketFinish], 
_socketEnd: [Function: onSocketEnd], 
secure: [Function], 
free: [Function: onFree], 
agentRemove: [Function: onRemove], 
drain: [Function: ondrain], 
error: [Function: socketErrorListener], 
data: [Function: socketOnData] }, 
_eventsCount: 10, 
connecting: false, 
_hadError: false, 
_handle: 
TLSWrap { 
bytesRead: 1369, 
_externalStream: {}, 
fd: -1, 
_parent: [Object], 
_parentWrap: undefined, 
_secureContext: [Object], 
reading: true, 
owner: [Circular], 
onread: [Function: onread], 
writeQueueSize: 1, 
onhandshakestart: [Function], 
onhandshakedone: [Function], 
onocspresponse: [Function], 
onerror: [Function] }, 
_parent: null, 
_host: 'stream.tradeking.com', 
_readableState: 
ReadableState { 
objectMode: false, 
highWaterMark: 16384, 
buffer: [Object], 
length: 0, 
pipes: null, 
pipesCount: 0, 
flowing: true, 
ended: false, 
endEmitted: false, 
reading: false, 
sync: false, 
needReadable: true, 
emittedReadable: false, 
readableListening: false, 
resumeScheduled: false, 
defaultEncoding: 'utf8', 
ranOut: false, 
awaitDrain: 0, 
readingMore: false, 
decoder: null, 
encoding: null }, 
readable: true, 
domain: null, 
_maxListeners: undefined, 
_writableState: 
WritableState { 
objectMode: false, 
highWaterMark: 16384, 
needDrain: false, 
ending: false, 
ended: false, 
finished: false, 
decodeStrings: false, 
defaultEncoding: 'utf8', 
length: 0, 
writing: false, 
corked: 0, 
sync: false, 
bufferProcessing: false, 
onwrite: [Function], 
writecb: null, 
writelen: 0, 
bufferedRequest: null, 
lastBufferedRequest: null, 
pendingcb: 0, 
prefinished: false, 
errorEmitted: false, 
bufferedRequestCount: 0, 
corkedRequestsFree: [Object] }, 
writable: true, 
allowHalfOpen: false, 
destroyed: false, 
_bytesDispatched: 539, 
_sockname: null, 
_pendingData: null, 
_pendingEncoding: '', 
server: undefined, 
_server: null, 
ssl: 
TLSWrap { 
bytesRead: 1369, 
_externalStream: {}, 
fd: -1, 
_parent: [Object], 
_parentWrap: undefined, 
_secureContext: [Object], 
reading: true, 
owner: [Circular], 
onread: [Function: onread], 
writeQueueSize: 1, 
onhandshakestart: [Function], 
onhandshakedone: [Function], 
onocspresponse: [Function], 
onerror: [Function] }, 
_requestCert: true, 
_rejectUnauthorized: true, 
parser: 
HTTPParser { 
'0': [Function: parserOnHeaders], 
'1': [Function: parserOnHeadersComplete], 
'2': [Function: parserOnBody], 
'3': [Function: parserOnMessageComplete], 
'4': null, 
_headers: [], 
_url: '', 
_consumed: false, 
socket: [Circular], 
incoming: [Circular], 
outgoing: [Object], 
maxHeaderPairs: 2000, 
onIncoming: [Function: parserOnIncomingClient] }, 
_httpMessage: 
ClientRequest { 
domain: null, 
_events: [Object], 
_eventsCount: 2, 
_maxListeners: undefined, 
output: [], 
outputEncodings: [], 
outputCallbacks: [], 
outputSize: 0, 
writable: true, 
_last: true, 
upgrading: false, 
chunkedEncoding: false, 
shouldKeepAlive: false, 
useChunkedEncodingByDefault: false, 
sendDate: false, 
_removedHeader: [Object], 
_contentLength: 0, 
_hasBody: true, 
_trailer: '', 
finished: true, 
_headerSent: true, 
socket: [Circular], 
connection: [Circular], 
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key="xxxxxxxxxxxxxxxxxx",oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWGI",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking 
.com\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-url 
encoded\r\n\r\n', 
_headers: [Object], 
_headerNames: [Object], 
_onPendingData: null, 
agent: [Object], 
socketPath: undefined, 
timeout: undefined, 
method: 'GET', 
path: '/v1/market/quotes?symbols=AAPL', 
_ended: false, 
parser: [Object], 
res: [Circular] }, 
read: [Function], 
_consuming: true }, 
connection: 
TLSSocket { 
_tlsOptions: 
{ pipe: null, 
secureContext: [Object], 
isServer: false, 
requestCert: true, 
rejectUnauthorized: true, 
session: undefined, 
NPNProtocols: undefined, 
ALPNProtocols: undefined, 
requestOCSP: undefined }, 
_secureEstablished: true, 
_securePending: false, 
_newSessionPending: false, 
_controlReleased: true, 
_SNICallback: null, 
servername: null, 
npnProtocol: false, 
alpnProtocol: false, 
authorized: true, 
authorizationError: null, 
encrypted: true, 
_events: 
{ close: [Object], 
end: [Object], 
finish: [Function: onSocketFinish], 
_socketEnd: [Function: onSocketEnd], 
secure: [Function], 
free: [Function: onFree], 
agentRemove: [Function: onRemove], 
drain: [Function: ondrain], 
error: [Function: socketErrorListener], 
data: [Function: socketOnData] }, 
_eventsCount: 10, 
connecting: false, 
_hadError: false, 
_handle: 
TLSWrap { 
bytesRead: 1369, 
_externalStream: {}, 
fd: -1, 
_parent: [Object], 
_parentWrap: undefined, 
_secureContext: [Object], 
reading: true, 
owner: [Circular], 
onread: [Function: onread], 
writeQueueSize: 1, 
onhandshakestart: [Function], 
onhandshakedone: [Function], 
onocspresponse: [Function], 
onerror: [Function] }, 
_parent: null, 
_host: 'stream.tradeking.com', 
_readableState: 
ReadableState { 
objectMode: false, 
highWaterMark: 16384, 
buffer: [Object], 
length: 0, 
pipes: null, 
pipesCount: 0, 
flowing: true, 
ended: false, 
endEmitted: false, 
reading: false, 
sync: false, 
needReadable: true, 
emittedReadable: false, 
readableListening: false, 
resumeScheduled: false, 
defaultEncoding: 'utf8', 
ranOut: false, 
awaitDrain: 0, 
readingMore: false, 
decoder: null, 
encoding: null }, 
readable: true, 
domain: null, 
_maxListeners: undefined, 
_writableState: 
WritableState { 
objectMode: false, 
highWaterMark: 16384, 
needDrain: false, 
ending: false, 
ended: false, 
finished: false, 
decodeStrings: false, 
defaultEncoding: 'utf8', 
length: 0, 
writing: false, 
corked: 0, 
sync: false, 
bufferProcessing: false, 
onwrite: [Function], 
writecb: null, 
writelen: 0, 
bufferedRequest: null, 
lastBufferedRequest: null, 
pendingcb: 0, 
prefinished: false, 
errorEmitted: false, 
bufferedRequestCount: 0, 
corkedRequestsFree: [Object] }, 
writable: true, 
allowHalfOpen: false, 
destroyed: false, 
_bytesDispatched: 539, 
_sockname: null, 
_pendingData: null, 
_pendingEncoding: '', 
server: undefined, 
_server: null, 
ssl: 
TLSWrap { 
bytesRead: 1369, 
_externalStream: {}, 
fd: -1, 
_parent: [Object], 
_parentWrap: undefined, 
_secureContext: [Object], 
reading: true, 
owner: [Circular], 
onread: [Function: onread], 
writeQueueSize: 1, 
onhandshakestart: [Function], 
onhandshakedone: [Function], 
onocspresponse: [Function], 
onerror: [Function] }, 
_requestCert: true, 
_rejectUnauthorized: true, 
parser: 
HTTPParser { 
'0': [Function: parserOnHeaders], 
'1': [Function: parserOnHeadersComplete], 
'2': [Function: parserOnBody], 
'3': [Function: parserOnMessageComplete], 
'4': null, 
_headers: [], 
_url: '', 
_consumed: false, 
socket: [Circular], 
incoming: [Circular], 
outgoing: [Object], 
maxHeaderPairs: 2000, 
onIncoming: [Function: parserOnIncomingClient] }, 
_httpMessage: 
ClientRequest { 
domain: null, 
_events: [Object], 
_eventsCount: 2, 
_maxListeners: undefined, 
output: [], 
outputEncodings: [], 
outputCallbacks: [], 
outputSize: 0, 
writable: true, 
_last: true, 
upgrading: false, 
chunkedEncoding: false, 
shouldKeepAlive: false, 
useChunkedEncodingByDefault: false, 
sendDate: false, 
_removedHeader: [Object], 
_contentLength: 0, 
_hasBody: true, 
_trailer: '', 
finished: true, 
_headerSent: true, 
socket: [Circular], 
connection: [Circular], 
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx ",oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWGI",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking 
.com\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-url 
encoded\r\n\r\n', 
_headers: [Object], 
_headerNames: [Object], 
_onPendingData: null, 
agent: [Object], 
socketPath: undefined, 
timeout: undefined, 
method: 'GET', 
path: '/v1/market/quotes?symbols=AAPL', 
_ended: false, 
parser: [Object], 
res: [Circular] }, 
read: [Function], 
_consuming: true }, 
httpVersionMajor: 1, 
httpVersionMinor: 1, 
httpVersion: '1.1', 
complete: false, 
headers: 
{ date: 'Mon, 20 Nov 2017 19:37:36 GMT', 
'content-type': 'text/html', 
'transfer-encoding': 'chunked', 
connection: 'close', 
'set-cookie': [ '__cfduid=d85337d9d3c2b7ad190e48a1bb3eb25f41511206655; expires=Tue, 20-Nov-18 19:37:35 GMT; path=/; domain=.tradeking.c 
om; HttpOnly' ], 
server: 'cloudflare-nginx', 
'cf-ray': '3c0ddd5f2f197961-SEA' }, 
rawHeaders: 
[ 'Date', 
'Mon, 20 Nov 2017 19:37:36 GMT', 
'Content-Type', 
'text/html', 
'Transfer-Encoding', 
'chunked', 
'Connection', 
'close', 
'Set-Cookie', 
'__cfduid=d85337d9d3c2b7ad190e48a1bb3eb25f41511206655; expires=Tue, 20-Nov-18 19:37:35 GMT; path=/; domain=.tradeking.com; HttpOnly', 
'Server', 
'cloudflare-nginx', 
'CF-RAY', 
'3c0ddd5f2f197961-SEA' ], 
trailers: {}, 
rawTrailers: [], 
upgrade: false, 
url: '', 
method: null, 
statusCode: 401, 
statusMessage: 'Unauthorized', 
client: 
TLSSocket { 
_tlsOptions: 
{ pipe: null, 
secureContext: [Object], 
isServer: false, 
requestCert: true, 
rejectUnauthorized: true, 
session: undefined, 
NPNProtocols: undefined, 
ALPNProtocols: undefined, 
requestOCSP: undefined }, 
_secureEstablished: true, 
_securePending: false, 
_newSessionPending: false, 
_controlReleased: true, 
_SNICallback: null, 
servername: null, 
npnProtocol: false, 
alpnProtocol: false, 
authorized: true, 
authorizationError: null, 
encrypted: true, 
_events: 
{ close: [Object], 
end: [Object], 
finish: [Function: onSocketFinish], 
_socketEnd: [Function: onSocketEnd], 
secure: [Function], 
free: [Function: onFree], 
agentRemove: [Function: onRemove], 
drain: [Function: ondrain], 
error: [Function: socketErrorListener], 
data: [Function: socketOnData] }, 
_eventsCount: 10, 
connecting: false, 
_hadError: false, 
_handle: 
TLSWrap { 
bytesRead: 1369, 
_externalStream: {}, 
fd: -1, 
_parent: [Object], 
_parentWrap: undefined, 
_secureContext: [Object], 
reading: true, 
owner: [Circular], 
onread: [Function: onread], 
writeQueueSize: 1, 
onhandshakestart: [Function], 
onhandshakedone: [Function], 
onocspresponse: [Function], 
onerror: [Function] }, 
_parent: null, 
_host: 'stream.tradeking.com', 
_readableState: 
ReadableState { 
objectMode: false, 
highWaterMark: 16384, 
buffer: [Object], 
length: 0, 
pipes: null, 
pipesCount: 0, 
flowing: true, 
ended: false, 
endEmitted: false, 
reading: false, 
sync: false, 
needReadable: true, 
emittedReadable: false, 
readableListening: false, 
resumeScheduled: false, 
defaultEncoding: 'utf8', 
ranOut: false, 
awaitDrain: 0, 
readingMore: false, 
decoder: null, 
encoding: null }, 
readable: true, 
domain: null, 
_maxListeners: undefined, 
_writableState: 
WritableState { 
objectMode: false, 
highWaterMark: 16384, 
needDrain: false, 
ending: false, 
ended: false, 
finished: false, 
decodeStrings: false, 
defaultEncoding: 'utf8', 
length: 0, 
writing: false, 
corked: 0, 
sync: false, 
bufferProcessing: false, 
onwrite: [Function], 
writecb: null, 
writelen: 0, 
bufferedRequest: null, 
lastBufferedRequest: null, 
pendingcb: 0, 
prefinished: false, 
errorEmitted: false, 
bufferedRequestCount: 0, 
corkedRequestsFree: [Object] }, 
writable: true, 
allowHalfOpen: false, 
destroyed: false, 
_bytesDispatched: 539, 
_sockname: null, 
_pendingData: null, 
_pendingEncoding: '', 
server: undefined, 
_server: null, 
ssl: 
TLSWrap { 
bytesRead: 1369, 
_externalStream: {}, 
fd: -1, 
_parent: [Object], 
_parentWrap: undefined, 
_secureContext: [Object], 
reading: true, 
owner: [Circular], 
onread: [Function: onread], 
writeQueueSize: 1, 
onhandshakestart: [Function], 
onhandshakedone: [Function], 
onocspresponse: [Function], 
onerror: [Function] }, 
_requestCert: true, 
_rejectUnauthorized: true, 
parser: 
HTTPParser { 
'0': [Function: parserOnHeaders], 
'1': [Function: parserOnHeadersComplete], 
'2': [Function: parserOnBody], 
'3': [Function: parserOnMessageComplete], 
'4': null, 
_headers: [], 
_url: '', 
_consumed: false, 
socket: [Circular], 
incoming: [Circular], 
outgoing: [Object], 
maxHeaderPairs: 2000, 
onIncoming: [Function: parserOnIncomingClient] }, 
_httpMessage: 
ClientRequest { 
domain: null, 
_events: [Object], 
_eventsCount: 2, 
_maxListeners: undefined, 
output: [], 
outputEncodings: [], 
outputCallbacks: [], 
outputSize: 0, 
writable: true, 
_last: true, 
upgrading: false, 
chunkedEncoding: false, 
shouldKeepAlive: false, 
useChunkedEncodingByDefault: false, 
sendDate: false, 
_removedHeader: [Object], 
_contentLength: 0, 
_hasBody: true, 
_trailer: '', 
finished: true, 
_headerSent: true, 
socket: [Circular], 
connection: [Circular], 
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx”,oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWGI",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking 
.com\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-url 
encoded\r\n\r\n', 
_headers: [Object], 
_headerNames: [Object], 
_onPendingData: null, 
agent: [Object], 
socketPath: undefined, 
timeout: undefined, 
method: 'GET', 
path: '/v1/market/quotes?symbols=AAPL', 
_ended: false, 
parser: [Object], 
res: [Circular] }, 
read: [Function], 
_consuming: true }, 
_consuming: false, 
_dumped: false, 
req: 
ClientRequest { 
domain: null, 
_events: 
{ response: [Function], 
prefinish: [Function: requestOnPrefinish] }, 
_eventsCount: 2, 
_maxListeners: undefined, 
output: [], 
outputEncodings: [], 
outputCallbacks: [], 
outputSize: 0, 
writable: true, 
_last: true, 
upgrading: false, 
chunkedEncoding: false, 
shouldKeepAlive: false, 
useChunkedEncodingByDefault: false, 
sendDate: false, 
_removedHeader: { connection: false, 'content-length': false }, 
_contentLength: 0, 
_hasBody: true, 
_trailer: '', 
finished: true, 
_headerSent: true, 
socket: 
TLSSocket { 
_tlsOptions: [Object], 
_secureEstablished: true, 
_securePending: false, 
_newSessionPending: false, 
_controlReleased: true, 
_SNICallback: null, 
servername: null, 
npnProtocol: false, 
alpnProtocol: false, 
authorized: true, 
authorizationError: null, 
encrypted: true, 
_events: [Object], 
_eventsCount: 10, 
connecting: false, 
_hadError: false, 
_handle: [Object], 
_parent: null, 
_host: 'stream.tradeking.com', 
_readableState: [Object], 
readable: true, 
domain: null, 
_maxListeners: undefined, 
_writableState: [Object], 
writable: true, 
allowHalfOpen: false, 
destroyed: false, 
_bytesDispatched: 539, 
_sockname: null, 
_pendingData: null, 
_pendingEncoding: '', 
server: undefined, 
_server: null, 
ssl: [Object], 
_requestCert: true, 
_rejectUnauthorized: true, 
parser: [Object], 
_httpMessage: [Circular], 
read: [Function], 
_consuming: true }, 
connection: 
TLSSocket { 
_tlsOptions: [Object], 
_secureEstablished: true, 
_securePending: false, 
_newSessionPending: false, 
_controlReleased: true, 
_SNICallback: null, 
servername: null, 
npnProtocol: false, 
alpnProtocol: false, 
authorized: true, 
authorizationError: null, 
encrypted: true, 
_events: [Object], 
_eventsCount: 10, 
connecting: false, 
_hadError: false, 
_handle: [Object], 
_parent: null, 
_host: 'stream.tradeking.com', 
_readableState: [Object], 
readable: true, 
domain: null, 
_maxListeners: undefined, 
_writableState: [Object], 
writable: true, 
allowHalfOpen: false, 
destroyed: false, 
_bytesDispatched: 539, 
_sockname: null, 
_pendingData: null, 
_pendingEncoding: '', 
server: undefined, 
_server: null, 
ssl: [Object], 
_requestCert: true, 
_rejectUnauthorized: true, 
parser: [Object], 
_httpMessage: [Circular], 
read: [Function], 
_consuming: true }, 
_header: 'GET /v1/market/quotes?symbols=AAPL HTTP/1.1\r\nAuthorization: OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx 
",oauth_nonce=" xxxxxxxxxxxxxxxxxx",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx 
",oauth_version="1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "\r\nHost: stream.tradeking.co 
m\r\nAccept: */*\r\nConnection: close\r\nUser-Agent: Node authentication\r\nContent-length: 0\r\nContent-Type: application/x-www-form-urlenc 
oded\r\n\r\n', 
_headers: 
{ authorization: 'OAuth oauth_consumer_key=" xxxxxxxxxxxxxxxxxx ",oauth_nonce="O0hLnA9vVHvI3KxCDiU23A4QjQxjiWG 
I",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1511206636",oauth_token=" xxxxxxxxxxxxxxxxxx ",oauth_version= 
"1.0",oauth_signature=" xxxxxxxxxxxxxxxxxx "', 
host: 'stream.tradeking.com', 
accept: '*/*', 
connection: 'close', 
'user-agent': 'Node authentication', 
'content-length': 0, 
'content-type': 'application/x-www-form-urlencoded' }, 
_headerNames: 
{ authorization: 'Authorization', 
host: 'Host', 
accept: 'Accept', 
connection: 'Connection', 
'user-agent': 'User-Agent', 
'content-length': 'Content-length', 
'content-type': 'Content-Type' }, 
_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: 'GET', 
path: '/v1/market/quotes?symbols=AAPL', 
_ended: false, 
parser: 
HTTPParser { 
'0': [Function: parserOnHeaders], 
'1': [Function: parserOnHeadersComplete], 
'2': [Function: parserOnBody], 
'3': [Function: parserOnMessageComplete], 
'4': null, 
_headers: [], 
_url: '', 
_consumed: false, 
socket: [Object], 
incoming: [Circular], 
outgoing: [Circular], 
maxHeaderPairs: 2000, 
onIncoming: [Function: parserOnIncomingClient] }, 
res: [Circular] } } 

Antwort

0

Ally invest hat eine geheime kleine Box, die überprüft werden muss, um Streaming-Quotes zu ermöglichen. Man muss zu seinen Profileinstellungen navigieren, dieses Kästchen finden und markieren, um API-Streaming zu erlauben. Es ist nicht klar, dass dies passieren muss, um den API-Stream zu erzeugen, es hat mir 3 Monate gedauert, bis er das geschafft hat! Wenn Ihnen das hilft, sind Sie willkommen !!!!!!!!!