= Motivations
In order to adress :
>>! In T7097#93820, @epriestley wrote:
> Out of curiosity, what's your reasoning for passing this through nginx instead of configuring a direct connection?
The instance is hosted in a virtualisation cluster that have a large bunch of IPV6 but only one IPv4 gateway and some dev cant access IPv6 (bad networks providers ect).
So I read {T7097} wich basically describes the same issue.
@joshuaspence tryed something in {D11423} but the revision was abandonned.
SO i digged into the code.
= What works well
- let `notification.client-uri` to default value
- start aphlict
- output `netstat -tulpn`
```
tcp 0 0 localhost:22280 *:* LISTEN 7317/node
tcp 0 0 localhost:22281 *:* LISTEN 7317/node
```
= What doesn't works
- set `notification.client-uri` to default `http://localhost/ws` as specified in docs
- start aphlict
- output `netstat -tulpn`
```
tcp 0 0 localhost:22281 *:* LISTEN 6685/node
```
As you can see client is not started
= As far as I understand
- `./bin/aphlict start ...` call [[ https://secure.phabricator.com/diffusion/P/browse/master/bin/aphlict | /bin/aphlict ]] that redirect to [[https://secure.phabricator.com/diffusion/P/browse/master/support/aphlict/server/aphlict_launcher.php | AphlictLauncher ]]
- call [[ https://secure.phabricator.com/diffusion/P/browse/master/src/applications/aphlict/management/PhabricatorAphlictManagementStartWorkflow.php | AphlictManagementStartWorklow]]
- call parent [[ https://secure.phabricator.com/diffusion/P/browse/master/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php | AphlictManagementWorklow]]
- call [[ https://secure.phabricator.com/diffusion/P/browse/master/src/applications/aphlict/management/PhabricatorAphlictManagementWorkflow.php$174 | getPort ]]
- which refer to [[ https://secure.phabricator.com/diffusion/PHU/browse/master/src/parser/PhutilURI.php$146 | libPhutil getPort ]]
- this basically return `''`
- this `''` will replace default value in [[ https://secure.phabricator.com/diffusion/P/browse/master/support/aphlict/server/aphlict_server.js$29 | Aphlict server]]
- then [[ https://secure.phabricator.com/diffusion/P/browse/master/support/aphlict/server/aphlict_server.js$132 | listen ]] wont happen since no port
= My Fix proposal
https://secure.phabricator.com/diffusion/P/browse/master/support/aphlict/server/aphlict_server.js$21-31
Replace
```
counterexample, lang=javascript
for (var ii = 2; ii < argv.length; ii++) {
var arg = argv[ii];
var matches = arg.match(/^--([^=]+)=(.*)$/);
if (!matches) {
throw new Error('Unknown argument "' + arg + '"!');
}
if (!(matches[1] in config)) {
throw new Error('Unknown argument "' + matches[1] + '"!');
}
config[matches[1]] = matches[2];
}
```
with :
```
lang=javascript
for (var ii = 2; ii < argv.length; ii++) {
var arg = argv[ii];
var matches = arg.match(/^--([^=]+)=(.*)$/);
if (!matches) {
throw new Error('Unknown argument "' + arg + '"!');
}
if (!(matches[1] in config)) {
throw new Error('Unknown argument "' + matches[1] + '"!');
}
if (matches[2] !== '') {
config[matches[1]] = matches[2];
}
}
```
**If you guys think its OK let me do a diff !!**
{meme, src = successkid, above = contributor badge, below = incomming}