Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Switching to your own web server

By default, all REST queries follow to the local address: http://localhost:9091/EchoApp

The invocations of REST methods look as follows then:

and so on.

This happens because the appKey=defaultApp parameter is sent when connection to the WCS server, and the default app for this key is this URL: http://localhost:9091/EchoApp

Image Added 


 To change these settings, enter to the command line interface of the WCS server via SSH:

Code Block
languagebash
themeRDark
ssh -p 2000 admin@localhost


Use the password you have specified when installing WCS.

The standard password is: admin

Upon successful authorization, WCS creates a command line:

Code Block
languagebash
themeRDark
>


You can execute the show apps command to see the current applications:

Code Block
languagebash
themeRDark
>show apps


Or enter the help command to display the list of available commands:

Code Block
languagebash
themeRDark
>help

Then, we create our own REST URL. It is created using the add app command.

Suppose, we allocated the following address on the web server for REST methods:

and so on.

So we configure this as follows:

Code Block
languagebash
themeRDark
>add app myApp myAppKey "http://mywebserver.com/rest"


This command creates a new URL, http://mywebserver.com/rest, and assigns this URL for usage if a client sent the appKey=’myAppKey’ during connection.

Therefore, if the newly created myAppKey is specified while creating the connection, the control is passed to the assigned URL

Flashphoner.createSession({appKey:’myAppKey’...});

http://mywebserver.com/rest/connect

Adding and deleting REST methods

By default, REST methods are not added to the newly configured URL. To add the REST methods, use the following CLI commands:

Code Block
languagebash
themeRDark
>add app-rest-method -a myApp


This will add all REST methods to the myApp application.

If you add all REST methods at once, make sure your HTTP URLs: http://mywebserver.com/rest/connect http://mywebserver.com/rest/playStream and others respond with 200 OK and return the data they have received.

Besides, you can add one specific REST method using the following command:

Code Block
languagebash
themeRDark
>add app-rest-method myApp connect


In this case only one REST method is added: connect.

To delete REST methods, use the following commands:


Code Block
languagebash
themeRDark
remove app-rest-method -a myApp
remove app-rest-method myApp connect



In this case, REST methods will be unassigned from your URL, and the corresponding REST methods - connect, playStream and others – will not be invoked.