Wowza Community

REST API doc error: Can't read from server.

I install as below tutorial:

https://www.wowza.com/docs/how-to-access-documentation-for-wowza-streaming-engine-rest-api

I extract and open index.html in folder RESTAPIDocumentationWebpage, it shows:

Can’t read from server. It may not have the appropriate access-control-origin settings.

I also search other topics and try to change port 8089 -> 8099 and restart server and press explore button with address http://localhost:8099/api-docs but the same issue occurs

when I access http://localhost:8099/api-docs via browser directly, web page shows

{"info":null,"apiVersion":"1.0.0","apis":[{"b":"Application Operations","path":"/v2/servers/{serverName}/vhosts/{vhostName}/applications","description":"Application Operations"},{"b":"Machine Level Current Statistics","path":"/v2/machine/monitoring/current","description":"Machine Level Current Statistics"},{"b":"Machine Level Historic Statistics","path":"/v2/machine/monitoring/historic","description":"Machine Level Historic Statistics"},{"b":"Server Licenses","path":"/v2/servers/{serverName}/licenses","description":"Server Licenses"},{"b":"Server Listeners","path":"/v2/servers/{serverName}/listeners","description":"Server Listeners"},{"b":"Server log4j system","path":"/v2/servers/{serverName}/log4j","description":"Server log4j system"},{"b":"Server MediaCache","path":"/v2/servers/{serverName}/mediacache","description":"Server MediaCache"},{"b":"Server MediaCasters","path":"/v2/servers/{serverName}/mediacasters","description":"Server MediaCasters"},{"b":"Server Monitoring","path":"/v2/servers/{serverName}/monitoring","description":"Server Monitoring"},{"b":"Server Publishers","path":"/v2/servers/{serverName}/publishers","description":"Server Publishers"},{"b":"REST information","path":"/restinfo","description":"REST information"},{"b":"Servers Configuration","path":"/v2/servers","description":"Servers Configuration"},{"b":"Server Status","path":"/v2/servers/{serverName}/status","description":"Server Status"},{"b":"Server Transcoder","path":"/v2/servers/{serverName}/transcoder","description":"Server Transcoder"},{"b":"Server Tuning","path":"/v2/servers/{serverName}/tune","description":"Server Tuning"},{"b":"Server Users","path":"/v2/servers/{serverName}/users","description":"Server Users"},{"b":"VHost Operations","path":"/v2/servers/{serverName}/vhosts","description":"VHost Operations"}],"swaggerVersion":"1.2","authorizations":null}

This is my Server.xml

<?xml version="1.0" encoding="UTF-8"?>
<Root version="2">
	<Server>
		<Name>Wowza Streaming Engine</Name>
		<Description>Wowza Streaming Engine is robust, customizable, and scalable server software that powers reliable streaming of high-quality video and audio to any device, anywhere.</Description>
		<RESTInterface>
			<Enable>true</Enable>
			<IPAddress>*</IPAddress>
			<Port>8087</Port>
			<!-- none, basic, digest-->
			<AuthenticationMethod>none</AuthenticationMethod>
			<DiagnosticURLEnable>true</DiagnosticURLEnable>
			<SSLConfig>
				<Enable>false</Enable>
				<KeyStorePath></KeyStorePath>
				<KeyStorePassword></KeyStorePassword>
				<KeyStoreType>JKS</KeyStoreType>
				<SSLProtocol>TLS</SSLProtocol>
				<Algorithm>SunX509</Algorithm>
				<CipherSuites></CipherSuites>
				<Protocols></Protocols>
			</SSLConfig>
			<IPWhiteList>127.0.0.1</IPWhiteList>
			<IPBlackList></IPBlackList>
			<EnableXMLFile>false</EnableXMLFile>
			<DocumentationServerEnable>true</DocumentationServerEnable>
			<DocumentationServerPort>8099</DocumentationServerPort>
			<!-- none, basic, digest-->
			<DocumentationServerAuthenticationMethod>none</DocumentationServerAuthenticationMethod>
			<Properties>
			    <Name>restUserHTTPHeaders</Name>
				<Value>Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type</Value>
			</Properties>
		</RESTInterface>
		<CommandInterface>
			<HostPort>
				<ProcessorCount>${com.wowza.wms.TuningAuto}</ProcessorCount>
				<IpAddress>*</IpAddress>
				<Port>8083</Port>
			</HostPort>
		</CommandInterface>
		<AdminInterface>
			<!-- Objects exposed through JMX interface: Server, VHost, VHostItem, Application, ApplicationInstance, MediaCaster, Module, Client, MediaStream, SharedObject, Acceptor, IdleWorker -->
			<ObjectList>Server,VHost,VHostItem,Application,ApplicationInstance,MediaCaster,Module,IdleWorker</ObjectList>
		</AdminInterface>
		<Stats>
			<Enable>true</Enable>
		</Stats>
		<!-- JMXUrl: service:jmx:rmi://localhost:8084/jndi/rmi://localhost:8085/jmxrmi -->
		<JMXRemoteConfiguration>
			<Enable>false</Enable>
			<IpAddress>localhost</IpAddress> <!-- set to localhost or internal ip address if behind NAT -->
			<RMIServerHostName>localhost</RMIServerHostName> <!-- set to external ip address or domain name if behind NAT -->
			<RMIConnectionPort>8084</RMIConnectionPort>
			<RMIRegistryPort>8085</RMIRegistryPort>
			<Authenticate>true</Authenticate>
			<PasswordFile>${com.wowza.wms.ConfigHome}/conf/jmxremote.password</PasswordFile>
			<AccessFile>${com.wowza.wms.ConfigHome}/conf/jmxremote.access</AccessFile>
			<SSLSecure>false</SSLSecure>
		</JMXRemoteConfiguration>
		<UserAgents>Shockwave Flash|CFNetwork|MacNetwork/1.0 (Macintosh)</UserAgents>
		<Streams>
			<DefaultStreamPrefix>mp4</DefaultStreamPrefix>
		</Streams>
		<ServerListeners>
			<ServerListener>
				<BaseClass>com.wowza.wms.mediacache.impl.MediaCacheServerListener</BaseClass>
			</ServerListener>
			<!--
			<ServerListener>
				<BaseClass>com.wowza.wms.plugin.loadbalancer.ServerListenerLoadBalancerListener</BaseClass>
			</ServerListener>
			-->
			<!--
			<ServerListener>
				<BaseClass>com.wowza.wms.plugin.loadbalancer.ServerListenerLoadBalancerSender</BaseClass>
			</ServerListener>
			-->
		</ServerListeners>
		<VHostListeners>
			<!--
			<VHostListener>
				<BaseClass></BaseClass>
			</VHostListener>
			-->
		</VHostListeners> 
		<HandlerThreadPool>
			<PoolSize>${com.wowza.wms.TuningAuto}</PoolSize>
		</HandlerThreadPool>
		<TransportThreadPool>
			<PoolSize>${com.wowza.wms.TuningAuto}</PoolSize>
		</TransportThreadPool>
		<RTP>
			<DatagramStartingPort>6970</DatagramStartingPort>
			<DatagramPortSharing>false</DatagramPortSharing>
		</RTP>
		<Manager>
			<!-- Properties defined are used by the Manager -->
			<Properties>
			</Properties>
		</Manager>
		<Transcoder>
			<PluginPaths>
				<QuickSync></QuickSync>
			</PluginPaths>
		</Transcoder>
		<!-- Properties defined here will be added to the IServer.getProperties() collection -->
		<Properties>
		</Properties>
	</Server>
</Root>

Could you please give me some suggestions for this issue?

Thanks for your time.

Hello

You might try whitelisting all ips in your xml to ensure that isn’t the issue:

<IPWhiteList>*</IPWhiteList>

Keep the port at 8089 and restart Wowza and reload the index.html page. Should you continue to see problems, zip up your conf/ and logs/ directories and send them to support here.

Thanks,

Matt

Hello

I just noticed in your Server.xml file that is missing the tag. So do the following:

			<Properties>
			    <Name>restUserHTTPHeaders</Name>
				<Value>Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type</Value>
			</Properties>

Change this to:

<Properties>
  <Property>	
     <Name>restUserHTTPHeaders</Name>
     <Value>Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type</Value>
  </Property>	
</Properties>

Let me know your progress.

Thanks,

Matt

Great, glad that helped. Thanks for the update.

Matt

hi Matt,

Thanks for your support, I modified Server doesn’t work, in log, I can see API document server started

RESTDocumentationServer: Bind attempt ([any]:8089)	-	-	
RESTDocumentationServer: Bind successful ([any]:8089)	-	
Wowza REST Documentation Server started	-	-	-	6.809	
RESTDocumentationServer: Using configs from:C:/Program Files
RESTDocumentationServer: BasicAuth:No	-	-	-	6.809	

Beside my account is trial version, I can’t access to support side, and I’m investigating this tool for my company before purchasing official one. Is there anything I can do with my situation?

Dear Matt,

My bad, I mix tab and , it works now. You save my day.

Thanks you very much

I know this is an old post, but I’m having the same problem. I have WSE running on an EC2 instance using the Wowza Linux AMI. I followed this tutorial to set up the docs: https://www.wowza.com/docs/how-to-access-documentation-for-wowza-streaming-engine-rest-api

For IPWhitelist I put the public IP address of the EC2 instance. I even tried * and it didn’t work.

When I try to bring the content up in Swagger I get the following error:

Can’t read from server. It may not have the appropriate access-control-origin settings.

It looks like a CORS error, I’m running the laster version of WSE so it should have the CORS headers by default but I added that to my Server.xml file just in case. No Joy.

If I try to drop the URL in a browser: http://ec2-54-191-22-177.us-west-2.compute.amazonaws.com:8089/api-docs

I get Site can’t be reached.

One other piece of information, I’m also running Django on this instance so I took port 80 and 443 out of VHost.xml - but that shouldn’t matter right? This is using port 8089.

Here is my Server.xml

<?xml version="1.0" encoding="UTF-8"?>

<Root version="2">

	<Server>

		<Name>Wowza Streaming Engine</Name>

		<Description>Wowza Streaming Engine is robust, customizable, and scalable server software that powers reliable streaming of high-quality video and audio to any device, anywhere.</Description>

		<RESTInterface>

			<Enable>true</Enable>

			<IPAddress>*</IPAddress>

			<Port>8087</Port>

			<!-- none, basic, digest, remotehttp, digestfile -->

			<AuthenticationMethod>none</AuthenticationMethod>

			<DiagnosticURLEnable>true</DiagnosticURLEnable>

			<SSLConfig>

				<Enable>false</Enable>

				<KeyStorePath></KeyStorePath>

				<KeyStorePassword></KeyStorePassword>

				<KeyStoreType>JKS</KeyStoreType>

				<SSLProtocol>TLS</SSLProtocol>

				<Algorithm>SunX509</Algorithm>

				<CipherSuites></CipherSuites>

				<Protocols></Protocols>

			</SSLConfig>

			<IPWhiteList>127.0.0.1,54.191.22.177,64.139.253.222</IPWhiteList>

			<IPBlackList></IPBlackList>

			<EnableXMLFile>false</EnableXMLFile>

			<DocumentationServerEnable>true</DocumentationServerEnable>

			<DocumentationServerPort>8089</DocumentationServerPort>

			<!-- none, basic, digest, remotehttp, digestfile -->

			<DocumentationServerAuthenticationMethod>none</DocumentationServerAuthenticationMethod>

			<Properties>

				<Property>

    					<Name>restUserHTTPHeaders</Name>

    					<Value>Access-Control-Allow-Origin:*|Access-Control-Allow-Methods:OPTIONS,GET,PUT,DELETE,POST|Access-Control-Allow-Headers:Content-Type</Value>

				</Property>

			</Properties>

		</RESTInterface>

		<CommandInterface>

			<HostPort>

				<ProcessorCount>${com.wowza.wms.TuningAuto}</ProcessorCount>

				<IpAddress>*</IpAddress>

				<Port>8083</Port>

			</HostPort>

		</CommandInterface>

		<AdminInterface>

			<!-- Objects exposed through JMX interface: Server, VHost, VHostItem, Application, ApplicationInstance, MediaCaster, Module, Client, MediaStream, SharedObject, Acceptor, IdleWorker -->

			<ObjectList>Server,VHost,VHostItem,Application,ApplicationInstance,MediaCaster,Module,IdleWorker</ObjectList>

		</AdminInterface>

		<Stats>

			<Enable>true</Enable>

			<Properties>

				<Property>

					<Name>statsManagerDebugEnable</Name>

					<Value>false</Value>

					<Type>Boolean</Type>

				</Property>

				<Property>

					<Name>statsDatabaseManagerDebugEnable</Name>

					<Value>false</Value>

					<Type>Boolean</Type>

				</Property>

			</Properties>

		</Stats>

		<!-- JMXUrl: service:jmx:rmi://localhost:8084/jndi/rmi://localhost:8085/jmxrmi -->

		<JMXRemoteConfiguration>

			<Enable>false</Enable>

			<IpAddress>${com.wowza.amazonaws.ec2.AWSEC2_METADATA_PUBLIC_IPV4}</IpAddress>

			<!--changed for default Amazon cloud install. <IpAddress>localhost</IpAddress>-->

			<!-- set to localhost or internal ip address if behind NAT -->

			<RMIServerHostName>${com.wowza.amazonaws.ec2.AWSEC2_METADATA_PUBLIC_HOSTNAME}</RMIServerHostName>

			<!--changed for default Amazon cloud install. <RMIServerHostName>localhost</RMIServerHostName>-->

			<!-- set to external ip address or domain name if behind NAT -->

			<RMIConnectionPort>8084</RMIConnectionPort>

			<RMIRegistryPort>8085</RMIRegistryPort>

			<Authenticate>true</Authenticate>

			<PasswordFile>${com.wowza.wms.ConfigHome}/conf/jmxremote.password</PasswordFile>

			<AccessFile>${com.wowza.wms.ConfigHome}/conf/jmxremote.access</AccessFile>

			<SSLSecure>false</SSLSecure>

		</JMXRemoteConfiguration>

		<UserAgents>Shockwave Flash|CFNetwork|MacNetwork/1.0 (Macintosh)</UserAgents>

		<Streams>

			<DefaultStreamPrefix>mp4</DefaultStreamPrefix>

		</Streams>

		<ServerListeners>

			<ServerListener>

				<BaseClass>com.wowza.wms.plugin.amazonaws.ec2.env.ServerListenerEC2Variables</BaseClass>

			</ServerListener>

			<ServerListener>

				<BaseClass>com.wowza.wms.mediacache.impl.MediaCacheServerListener</BaseClass>

			</ServerListener>

			<ServerListener>

				<BaseClass>com.wowza.wms.plugin.streampublisher.ServerListenerStreamPublisher</BaseClass>

			</ServerListener>

		</ServerListeners>

		<VHostListeners>

			<!--

			<VHostListener>

				<BaseClass></BaseClass>

			</VHostListener>

			-->

		</VHostListeners>

		<HandlerThreadPool>

			<PoolSize>${com.wowza.wms.TuningAuto}</PoolSize>

		</HandlerThreadPool>

		<TransportThreadPool>

			<PoolSize>${com.wowza.wms.TuningAuto}</PoolSize>

		</TransportThreadPool>

		<RTP>

			<DatagramStartingPort>6970</DatagramStartingPort>

			<DatagramPortSharing>false</DatagramPortSharing>

		</RTP>

		<Manager>

			<!-- Properties defined are used by the Manager -->

			<Properties>

			</Properties>

		</Manager>

		<Transcoder>

			<PluginPaths>

				<QuickSync></QuickSync>

			</PluginPaths>

		</Transcoder>

		<!-- Properties defined here will be added to the IServer.getProperties() collection -->

		<Properties>

		</Properties>

	</Server>

</Root>

Hi Jim,

EC2 instances have Security Groups that specify the traffic that is allowed to your Wowza Streaming Engine. Please make sure that you are allowing port 8089 on this server instance. Then, from your client machine where Swagger UI is installed, try sending a curl request to the api-docs that show headers.

curl -v http://ec2-54-191-22-177.us-west-2.compute.amazonaws.com:8089/api-docs

You should see valid CORS headers returned similar to:

< Access-Control-Expose-Headers: Date,Server,Content-Type,Content-Length,WWW-Authenticate
< Access-Control-Allow-Origin: *
< Access-Control-Allow-Credentials: true
< Access-Control-Allow-Methods: OPTIONS,GET,PUT,DELETE,POST
< Access-Control-Allow-Headers: Content-Type

Michelle

I am not sure why WebSphere would be any different. when I am Enabling CORS is normally done at the application level, though tomcat has its own filter you may have used. Just enable it on WebSphere and you should be done. if still not resolve then you can contact Antivirus Customer Support for virus and malware issue.