我在4901端口上运行ngrok。
我也在同一个端口上运行一个烧瓶网络服务器。我的想法是,我想从外部访问我的本地网络服务器进行一些应用程序测试。
我错过了什么?
NGROK在4901上运行
import { Component } from "@angular/core";
import { ionicBootstrap, Platform, Nav } from "ionic-angular";
import { AService } from "./services/a-service";
import { BService } from "./services/b-service";
import { CService } from "./services/c-service";
import { UserData } from "./providers/user-data";
import { HomePage } from "./pages/home/home";
@Component({
templateUrl: "build/app.html"
})
export class MyApp {
// the root nav is a child of the root app component
// @ViewChild(Nav) gets a reference to the app's root nav
@ViewChild(Nav) nav: Nav;
rootPage: any = HomePage;
pages: Array<{ title: string, component: any }>;
constructor(
private platform: Platform,
private aSvc: AService,
private bSvc: BService,
private cSvc: CService,
private userData: UserData
) {
this.initializeApp();
// array of pages in your navigation
this.pages = [
{ title: "Home Page", component: HomePage }
];
}
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
bSvc.setOnline(true);
});
}
openPage(page) {
// Reset the content nav to have just this page
// we wouldn't want the back button to show in this scenario
this.nav.setRoot(page.component);
}
}
// Pass the main app component as the first argument
// Pass any providers for your app in the second argument
// Set any config for your app as the third argument:
// http://ionicframework.com/docs/v2/api/config/Config/
ionicBootstrap(MyApp, [AService, BService, CService, UserData]);
烧瓶中:
./ngrok 4901
ngrok
Tunnel Status reconnecting Version
1.7/ Web Interface 127.0.0.1:4040
# Conn 0 Avg Conn Time 0.00ms
答案 0 :(得分:1)
您使用的是ngrok 1.7版,现已完全关闭。引自their announcement:
截至2016年4月4日,所有1.X会话已不再存在且服务已完全结束。
您应该可以升级到2.0+版本并继续使用它,尽管我自己还没有尝试过。