forked from digitalbazaar/forge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove autotools based build suport. - Add npm flash build support. - Move mod_fsp to flash/. - Move swf/ to flash/swf/. - Move policy servers to flash/. - Update READMEs.
- Loading branch information
Showing
16 changed files
with
164 additions
and
680 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Forge Flash Support | ||
=================== | ||
|
||
SocketPool.swf | ||
-------------- | ||
|
||
Some special networking features can optionally use a Flash component. | ||
Building the output SWF file requires the [Flex SDK][]. A pre-built component | ||
is included: `swf/SocketPool.swf`. | ||
|
||
Building the output SWF requires the `mxmlc` tool from the [Flex SDK][]. If | ||
that tools is already installed then look in the `package.json` file for the | ||
commands to rebuild it. If you need the SDK installed, there is a npm module that installs it: | ||
|
||
npm install | ||
|
||
To build a regular component: | ||
|
||
npm run build | ||
|
||
Additional debug support can be built in with the following: | ||
|
||
npm run build-debug | ||
|
||
Policy Server | ||
------------- | ||
|
||
Flash support requires the use of a Policy Server. | ||
|
||
### Apache Flash Socket Policy Module | ||
|
||
[mod_fsp](./mod_fsp) provides an [Apache][] module that can serve up a Flash | ||
Socket Policy. See `mod_fsp/README` for more details. This module makes it easy | ||
to modify an [Apache][] server to allow cross domain requests to be made to it. | ||
|
||
### Simple Python Policy Server | ||
|
||
`policyserver.py` provides a very simple test policy server. | ||
|
||
### Simple Node.js Policy Server | ||
|
||
`policyserver.js` provides a very simple test policy server. If a server is | ||
needed for production environments, please use another option such as perhaps | ||
[nodejs_socket_policy_server][]. | ||
|
||
[Apache]: http://httpd.apache.org/ | ||
[Flex SDK]: https://flex.apache.org/ | ||
[nodejs_socket_policy_server]: https://github.com/bichinger/nodejs_socket_policy_server |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"name": "node-forge-flash", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "Flash build support for Forge.", | ||
"homepage": "https://github.com/digitalbazaar/forge", | ||
"author": { | ||
"name": "Digital Bazaar, Inc.", | ||
"email": "[email protected]", | ||
"url": "http://digitalbazaar.com/" | ||
}, | ||
"devDependencies": { | ||
"flex-sdk": "" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/digitalbazaar/forge" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/digitalbazaar/forge/issues", | ||
"email": "[email protected]" | ||
}, | ||
"license": "(BSD-3-Clause OR GPL-2.0)", | ||
"scripts": { | ||
"build": "mxmlc -debug=false -define=CONFIG::debugging,false -define=CONFIG::release,true -compiler.source-path=. -static-link-runtime-shared-libraries -output=swf/SocketPool.swf SocketPool.as", | ||
"build-debug": "mxmlc -debug=true -define=CONFIG::debugging,true -define=CONFIG::release,false -compiler.source-path=. -static-link-runtime-shared-libraries -output=swf/SocketPool.swf SocketPool.as" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
/** | ||
* Forge test Flash Policy Server. | ||
* | ||
* @author Dave Longley | ||
* @author David I. Lehn | ||
* | ||
* Copyright (c) 2010-2016 Digital Bazaar, Inc. | ||
*/ | ||
const net = require('net'); | ||
const program = require('commander'); | ||
|
||
// The policy file | ||
// NOTE: This format is very strict. Edit with care. | ||
let policyFile = | ||
'<?xml version="1.0"?>' + | ||
'<!DOCTYPE cross-domain-policy' + | ||
' SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">' + | ||
'<cross-domain-policy>' + | ||
'<allow-access-from domain="*" to-ports="*"/>' + | ||
'</cross-domain-policy>\0'; | ||
|
||
// Simple non-robust policy file server. | ||
// Looks for a request string and returns the policy file. | ||
exports.policyServer = function(port) { | ||
let prefix = '[policy-server] '; | ||
let server = net.createServer((socket) => { | ||
let remoteAddress = socket.remoteAddress + ':' + socket.remotePort; | ||
console.log(prefix + 'new client connection from %s', remoteAddress); | ||
|
||
// deal with strings | ||
socket.setEncoding('utf8'); | ||
|
||
socket.on('data', (d) => { | ||
if(d.indexOf('<policy-file-request/>') === 0) { | ||
console.log(prefix + 'policy file request from: %s', remoteAddress); | ||
socket.write(policyFile); | ||
} else { | ||
console.log(prefix + 'junk request from %s: %j', remoteAddress, d); | ||
} | ||
}); | ||
socket.once('close', () => { | ||
console.log(prefix + 'connection from %s closed', remoteAddress); | ||
}); | ||
socket.on('error', (err) => { | ||
console.error( | ||
prefix + 'connection %s error: %s', remoteAddress, err.message); | ||
}); | ||
}).on('error', (err) => { | ||
throw err; | ||
}); | ||
server.listen(port, () => { | ||
console.log(prefix + 'listening: ', server.address()); | ||
}); | ||
}; | ||
|
||
if(require.main === module) { | ||
program | ||
//.option('--host [host]', | ||
// 'host to bind to [localhost]') | ||
.option('--policy-port [port]', | ||
'port used to serve policy file [19945]', 19945) | ||
.parse(process.argv); | ||
|
||
exports.policyServer(program.policyPort); | ||
} |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.