![]() |
FRED™
3.0
FRED™: Framework for Rapid and Easy Development
|
Public Member Functions | |
| action ($controller_name, $action, $params=null, $read_length=1024) | |
| Request an action from the HTTP Server on the WebSocket server. More... | |
| token ($params=null) | |
| Create a WebSocket access token. More... | |
Public Member Functions inherited from Component | |
| __construct ($fred, $config=null) | |
| __destruct () | |
| clientConfig () | |
| Public configuration. More... | |
| config ($key, $default=null) | |
| Retrieve a config value. More... | |
| ping () | |
| Ping function. More... | |
| filemtime ($filename) | |
| Filemtime with session cache. More... | |
| component ($name) | |
| Get a component (local or default). More... | |
| components (... $names) | |
| Get multiple components in an array. More... | |
Public Member Functions inherited from Thing | |
| propertyExists ($property) | |
| Check if a property exists (public or published). More... | |
| constants ($prefix=null) | |
| Return all constants. More... | |
| get ($key) | |
| Get one or more properties. More... | |
| set ($key, $value=null) | |
| Set one or more properties. More... | |
| __get ($key) | |
| __set ($key, $value) | |
Data Fields | |
| $clientHost = null | |
| Host the WebSocket server is running on (for public connections; empty = same as HTTP). More... | |
| $clientPort = null | |
| Port client websockets can connect to (empty = no connection allowed). More... | |
| $clientPrefix = null | |
| Prefix for websocket requests (for example when tunneling WSS traffic). More... | |
| $clientLocalPort = null | |
| When the WebSocket server should listen on another local port then the client connects. More... | |
| $clientOrigins = [] | |
| Allowed origins (empty = all). More... | |
| $tokenTtl = 30 | |
| Time a request token is valid (seconds). More... | |
| $localHost = 'localhost' | |
| Host the WebSocket server is running on (for local connections). More... | |
| $localPort = 6871 | |
| Port for local connections (HTTP server <-> WebSocket server). More... | |
| $localClients = ['127.0.0.1','::1'] | |
| Allowed clients for a local connection. More... | |
Data Fields inherited from Component | |
| $filemtimeTtl = 0 | |
Data Fields inherited from Thing | |
| const | HIDDEN = 0 |
| Property is hidden. More... | |
| const | READABLE = 1 |
| Property is readable. More... | |
| const | WRITEABLE = 2 |
| Property is writeable. More... | |
| const | READWRITE = 3 |
| Property is readable and writeable. More... | |
Protected Member Functions | |
| getServer () | |
Protected Member Functions inherited from Component | |
| init () | |
| done () | |
| getSession () | |
Protected Member Functions inherited from Thing | |
| publish ($property, $visibility=self::READABLE) | |
| Publish a property (or hide it again). More... | |
| configure ($config) | |
| Configure the object. More... | |
| _get ($key) | |
| Default getter if no specific setter is defined, and the property is also not published (readable). More... | |
| _set ($key, $value) | |
| Default setter if no specific setter is defined, and the property is also not published (writeable). More... | |
Protected Attributes | |
| $_server = null | |
| WebSocket server. More... | |
Protected Attributes inherited from Component | |
| $_fred = null | |
| $_config = null | |
| $_name = null | |
| $_components = [] | |
| Local components (key = component name, value = component). More... | |
| $_session = null | |
Protected Attributes inherited from Thing | |
| $_published = [] | |
| Published properties (key = name of property, value = visibility). More... | |
Definition at line 5 of file Socket.php.
| action | ( | $controller_name, | |
| $action, | |||
$params = null, |
|||
$read_length = 1024 |
|||
| ) |
Request an action from the HTTP Server on the WebSocket server.
| string | $controller_name | Controler to apply the action on (empty = local action). |
| string | $action | Requested action. |
| mixed | $params | Parameters for the action. |
| int | $read_length | Maximum number of bytes to read. |
Definition at line 30 of file Socket.php.
|
protected |
Definition at line 55 of file Socket.php.
| token | ( | $params = null | ) |
Create a WebSocket access token.
| array | $params | Parameters to pass to the WebSocket server (this is used as the session - read-only). |
Definition at line 49 of file Socket.php.
|
protected |
WebSocket server.
Definition at line 19 of file Socket.php.
| $clientHost = null |
Host the WebSocket server is running on (for public connections; empty = same as HTTP).
Definition at line 7 of file Socket.php.
| $clientLocalPort = null |
When the WebSocket server should listen on another local port then the client connects.
Definition at line 10 of file Socket.php.
| $clientOrigins = [] |
Allowed origins (empty = all).
Definition at line 12 of file Socket.php.
| $clientPort = null |
Port client websockets can connect to (empty = no connection allowed).
Definition at line 8 of file Socket.php.
| $clientPrefix = null |
Prefix for websocket requests (for example when tunneling WSS traffic).
Definition at line 9 of file Socket.php.
| $localClients = ['127.0.0.1','::1'] |
Allowed clients for a local connection.
Definition at line 17 of file Socket.php.
| $localHost = 'localhost' |
Host the WebSocket server is running on (for local connections).
Definition at line 15 of file Socket.php.
| $localPort = 6871 |
Port for local connections (HTTP server <-> WebSocket server).
Definition at line 16 of file Socket.php.
| $tokenTtl = 30 |
Time a request token is valid (seconds).
Definition at line 13 of file Socket.php.