Skip to content

Commit

Permalink
verbiage tweaks. also ngrok kill adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
eanders-ms committed Nov 13, 2016
1 parent c91e106 commit 0f3a053
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/client/dialogs/appSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ export class AppSettingsDialog extends React.Component<{}, {}> {
</ul>
<hr className='enu-navhdr' />
<div className={"emu-tab" + (this.currentTab === Tabs.ServiceUrl ? " emu-visible" : " emu-hidden")}>
<div className='emu-dialog-text'>The Callback URL is where the bot you're communicating with sends reply messages.</div>
<div className={'emu-dialog-text' + (this.serviceUrlReadOnly ? '' : ' emu-hidden')}>NOTE: ngrok is controlling the value of this field. Clear your ngrok path to regain control of this value.</div>
<div className='emu-dialog-text'>The Callback URL is where the bot sends reply messages.</div>
<div className={'emu-dialog-text' + (this.serviceUrlReadOnly ? '' : ' emu-hidden')}>Note: ngrok is currently in control of this field. Clear your ngrok path to regain control of it.</div>
<div className="input-group">
<label className="form-label">
Callback URL:
Expand Down
8 changes: 4 additions & 4 deletions src/server/botFrameworkService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ export class BotFrameworkService extends RestServer {
}, (err, url: string, inspectPort: string) => {
if (err) {
log.warn(`failed to start ngrok: ${err.message || err.msg}`);
log.debug(`to configure ngrok`, log.makeLinkMessage('click here', 'emulator://appsettings?tab=NgrokConfig'));
log.debug(log.makeLinkMessage('click here', 'emulator://appsettings?tab=NgrokConfig'), 'to configure ngrok');
} else {
this.inspectUrl = `http://127.0.0.1:${inspectPort}`;
this.inspectUrl = `http://localhost:${inspectPort}`;
this.ngrokServiceUrl = url;
log.debug(`ngrok listening on: ${url}`);
log.debug('inspectorUrl:', log.makeLinkMessage(this.inspectUrl, this.inspectUrl));
log.debug('ngrok inspector:', log.makeLinkMessage(this.inspectUrl, this.inspectUrl));
}
// Sync settings to client
getStore().dispatch({
Expand All @@ -136,7 +136,7 @@ export class BotFrameworkService extends RestServer {
log.debug('ngrok stopped');
startNgrok();
return true;
}) || startNgrok();
});
} else {
ngrok.disconnect(prevServiceUrl, () => {
startNgrok();
Expand Down
15 changes: 12 additions & 3 deletions src/server/ngrok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,22 @@ export function disconnect(url, cb) {
export function kill(cb) {
cb = cb || noop;
if (!ngrok) {
return cb(false);
cb(false);
return;
}
ngrok.on('exit', function () {
api = null;
tunnels = {};
emitter.emit('disconnect');
return cb(true);
cb(true);
});
return ngrok.kill();
try {
if (!ngrok.kill())
throw "err-cleanup";
} catch (e) {
api = null;
ngrok = null;
tunnels = {};
cb(false);
}
}

0 comments on commit 0f3a053

Please sign in to comment.