项目作者: bichinger

项目描述 :
Unity3D & Adobe Flash Socket Policy server for node.js
高级语言: JavaScript
项目地址: git://github.com/bichinger/nodejs_socket_policy_server.git
创建时间: 2014-02-09T21:31:41Z
项目社区:https://github.com/bichinger/nodejs_socket_policy_server

开源协议:MIT License

下载


nodejs_socket_policy_server

A simple and fast Unity3D/Flash Socket Policy server for node.js. For more
information about socket policy files have a look at Loading Data in Flash/Flex/Air or Unity 3D Security Sandbox.

Installation

  1. $ npm install -g socket-policy-server

Configuration

  1. $ npm config --global set socket-policy-server:host <ip address or blank>

Sets the IP to listen to for serving the socket policy file. Pass a single IP
address to listen only on that IP or leave blank to listen on all IPs. Default
is blank (listen on all IPs, which is equivalent to IP 0.0.0.0).

  1. $ npm config --global set socket-policy-server:port 843

Set the port to listen on. Default is 843.

  1. $ npm config --global set socket-policy-server:timeout 5000

Sets the wait time in milliseconds after an incoming connection. The client has
this much time to send its request string or it will be disconnected. Defaults
to 5000.

  1. $ npm config --global set logging true/false

Globally turns logging on/off (affects log_request_data and logfile options).

  1. $ npm config --global set socket-policy-server:log_request_data false

Indicates if the server should log incoming request strings. Use only for
debugging purposes! Defaults to false.

  1. $ npm config --global set socket-policy-server:logfile /var/log/socket-policy-server.log

Sets the log file. Defaults to /var/log/socket-policy-server.log.
Note that this file will be overwritten, not appended to!

  1. $ npm config --global set socket-policy-server:error_logfile /var/log/socket-policy-server-error.log

Sets the error log file. Defaults to /var/log/socket-policy-server-error.log.
Note that this file will be overwritten, not appended to!

  1. $ npm config --global set socket-policy-server:policyfile socket_policy.xml

Sets the socket policy file that will be sent out. Defaults to socket_policy.xml
(relative path). The embedded socket policy file only grants access to
ports 80 and 443. If you need to change that, create your own file and set its
path with this configuration option.

Usage

  1. $ npm -g start socket-policy-server

Starts the server.

  1. $ npm -g stop socket-policy-server

Stops the server.

  1. $ npm -g restart socket-policy-server

Stops, then starts the server.

  1. $ npm -g run-script socket-policy-server status

Prints out the current status of the server (mainly if it is running or not).

License

see file LICENSE