My goal is to add facebook stream target in wowza application via node js application. I have got facebook ENC-XXXX token and destination Id using this I am making a http call to wowza application from my node js application i am getting this error:
Status Code: 405 Exception: Request method 'POST' not supported<br>Stacktrace:
Generated by Winstone Servlet Engine v1.0.5 at Thu Mar 22 13:45:07 IST 2018
Here is the code:
var options = { method: 'POST',
url: 'http://192.168.9.85:8088/enginemanager/applications/live/streamtarget/add.htm',
qs:
{ enabled: 'true',
protocol: 'RTMP',
destinationName: 'facebook',
destApplicationRequired: 'true',
destAppInstanceRequired: 'false',
usernameRequired: 'false',
passwordRequired: 'false',
wowzaCloudDestinationType: '',
facebookUserName: 'AN SH',
facebookAccessToken: 'ENC-XXXXXXXXXXX',
facebookDestName: 'My Timeline',
facebookDestId: 'XXXXXXXXXXXXXXXXXX',
facebookEventSourceName: '',
wowzaDotComFacebookUrl: 'https://fb.wowza.com/wsem/stream_targets/v1',
wowzaCloudAdaptiveStreaming: 'true',
wowzaCdnCloudAccountApiKey: '',
wowzaCdnCloudAccountAccessKey: '',
wowzaCdnCloudAccountName: '',
wowzaCdnCloudAccountId: '',
wowzaCdnCloudTargetId: '',
wowzaCdnCloudPlaybackUrl: '',
protocolAkamai: 'RTMP',
protocolShoutcast: 'shoutcast2',
streamTargetName: 'Hello',
connectionCode: '',
wowzaCloudABRRadio: 'multiple',
sourceStreamName: 'tester_160p',
sourceStreamNamePrefix: '',
shoutcastHost: '',
shoutcastPort: '',
shoutcastUsername: '',
shoutcastPassword: '',
shoutcastDestination: '',
shoutcastDescription: '',
shoutcastName: '',
shoutcastGenre: '',
shoutcastMetaFormat: '',
shoutcastURL: '',
shoutcastAIM: '',
shoutcastICQ: '',
shoutcastIRC: '',
_shoutcastPublic: 'on',
destApplication: '',
alibabaDestApplication: '',
destAppInstance: '',
destHostRTMP: '',
destPortRTMP: '1935',
destStreamNameRTMP: '',
username: '',
password: '',
alibabaDestPortRTMP: '1935',
alibabaDestStreamNameRTMP: '',
akamaiStreamIdRTMP: '',
_akamaiSendToBackupServer: 'on',
destStreamNameRTP: '',
destHostRTP: '',
videoPort: '',
audioPort: '',
streamWaitTimeout: '5000',
timeToLiveRTP: '63',
srtDestHost: '',
srtDestPort: '',
srtRecoveryBuffer: '400',
srtKeyLength: 'AES-128',
srtPassPhrase: '',
destStreamNameMPEGTS: '',
destHostMPEGTS: '',
destPortMPEGTS: '1935',
timeToLiveMPEGTS: '63',
_rtpWrap: 'on',
destStreamNameHTTP: '',
destHostHTTPAkamai: '',
akamaiStreamIdHTTP: '',
akamaiHostId: '',
httpPlaylistCount: '0',
akamaiEventName: '',
adaptiveGroups: '',
akamaiDestinationServer: 'primary',
cupertinoRenditionAudioVideo: 'true',
_cupertinoRenditionAudioVideo: 'on',
_cupertinoRenditionAudioOnly: 'on',
sanjoseRepresentationId: '',
mpegdashVideoRepresentationId: '',
mpegdashAudioRepresentationId: '',
_autoStart: 'on',
wowzaCloudDestinationServer: 'primary',
wowzaCdnCloudEmail: '',
wowzaCdnCloudPassword: '',
facebookTitle: 'Title',
facebookDescription: 'Description',
facebookContinuousLive: 'true',
_facebookContinuousLive: 'on',
facebook360Projection: 'none',
facebookDestType: 'timeline',
facebookPrivacy: 'onlyMe',
debugLog: 'false',
debugLogChildren: 'false',
sendSSL: 'false',
secureTokenSharedSecret: '',
adaptiveStreaming: 'false',
sendFCPublish: 'true',
sendReleaseStream: 'true',
sendStreamCloseCommands: 'true',
removeDefaultAppInstance: 'true',
sendOriginalTimecodes: 'true',
originalTimecodeThreshold: '0x100000',
connectionFlashVersion: '',
queryString: '',
localBindAddress: '',
debugPackets: 'false',
akamaiHdNetwork: 'true',
httpPlaylistAcrossSessions: 'false',
httpPlaylistTimeout: '120000',
httpFakePosts: 'false',
httpWriterDebug: 'false',
vhost: '_defaultVHost_',
appName: 'webrtc' },
headers:
{
'content-type': 'application/x-www-form-urlencoded' } };
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body); });
When i am making same XHR call using $.ajax i am getting this cors error:
Home.htm#application/_defaultVHost_/live/live/main/:1 XMLHttpRequest cannot load http://192.168.9.85:8088/enginemanager/applications/live/streamtarget/add.h…pFakePosts=false&httpWriterDebug=false&vhost=_defaultVHost_&appName=webrtc.
Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8088' is therefore not allowed access.