router

SSH -L connection successful, but localhost port forwarding not working “channel 3: open failed: connect failed: Connection refused”

烂漫一生 提交于 2019-11-27 19:00:46
My lab runs RStudio on a server. A couple weeks ago, from my cousin's house, I successfully ssh'd into the server and pulled up the server-side RStudio through my local Firefox browser. Now when I try to access the server RStudio from home (via my own router), it doesn't work. I need help troubleshooting, and I'm guessing it's some problem on the router. I'm running Mac OSX 10.6.8. No idea what the university server's running, but I don't think it's a server-side problem. Here's how it worked the first time I did it, at my cousin's house: first, I VPN into the university network; then I call

Angular2 Router error: cannot find primary outlet to load 'HomePage'

烈酒焚心 提交于 2019-11-27 12:32:07
I just started using the new routing library (@angular/router v3.0.0-alpha.7) but following the official docs leads to error below: browser_adapter.ts:74: EXCEPTION: Error: Uncaught (in promise): Error: Cannot find primary outlet to load 'HomePage' Question is - how do I get rid of the error and make the router behave as expected? Have I missed a setting? (Same error appears when using the alpha.6 version.) app.component.ts import { Component } from '@angular/core'; import { ROUTER_DIRECTIVES } from '@angular/router'; @Component({ selector: 'app', template: ` <p>Angular 2 is running...</p> <!-

Redirect user with router depending on logged in status

久未见 提交于 2019-11-27 09:29:43
问题 I would like to automatically route to a login page if the user is not logged in. app.module.ts import { RouterModule, Routes } from '@angular/router'; import { AppComponent } from './app.component'; import { LoginComponent } from './login/login.component'; import { DashBoardComponent} from './dashboard/dashboard.component'; import { NotFoundComponent } from './not-found/not-found.component'; const APPROUTES: Routes = [ {path: 'home', component: AppComponent}, {path: 'login', component:

Angular2 conditional routing

不羁岁月 提交于 2019-11-27 09:01:12
This might be a basic question, but in Angular2 is there any way to do conditional routing ? Or, would someone do that outside the router ? I know ui-router had some ability to do this, but I haven't seen anything similar in Angular2s router Günter Zöchbauer update In the new router guards can be used instead https://angular.io/guide/router#milestone-5-route-guards original (for the long gone router) Implement the CanActivate lifecycle hook like shown here Life cycle hooks in Angular2 router and return false if you want to prevent the navigation. See also https://angular.io/docs/ts/latest/api

Ruby on rails: singular resource and form_for

让人想犯罪 __ 提交于 2019-11-27 05:30:50
问题 I want user to work with only one order connected to user's session. So I set singular resource for order routes.rb: resource :order views/orders/new.html.erb: <%= form_for @order do |f| %> ... <% end %> But when I open the new order page I get an error: undefined method `orders_path` I know, that I can set :url => order_path in form_for , but what is the true way of resolving this collision? 回答1: Unfortunately, this is a bug. You'll have to set the url like you mention. = form_for @order,

Adding sub domain based routes in Zend framework

被刻印的时光 ゝ 提交于 2019-11-27 01:45:50
问题 I am newbie to Zend framework, I am using .ini file to add routes in my application. I have 2 routes for different modules which resources.router.routes.news_view.type = "Zend_Controller_Router_Route_Regex" resources.router.routes.news_view.route = "([0-9\-]+)/([a-zA-Z0-9\-]+)\.html" resources.router.routes.news_view.defaults.module = "news" resources.router.routes.news_view.defaults.controller = "index" resources.router.routes.news_view.defaults.action = "view" resources.router.routes.news

Objective-C : How to fetch the router address?

夙愿已清 提交于 2019-11-27 01:22:37
I tried to fetch the router address this way. - (NSString *) routerIp { NSString *address = @"error"; struct ifaddrs *interfaces = NULL; struct ifaddrs *temp_addr = NULL; int success = 0; // retrieve the current interfaces - returns 0 on success success = getifaddrs(&interfaces); if (success == 0) { // Loop through linked list of interfaces temp_addr = interfaces; while(temp_addr != NULL) { if(temp_addr->ifa_addr->sa_family == AF_INET) { // Check if interface is en0 which is the wifi connection on the iPhone if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) { //

How to separate routes on Node.js and Express 4?

隐身守侯 提交于 2019-11-27 00:17:19
I want to separate Routes from my server.js file. I am following this tutorial on Scotch.io http://scotch.io/tutorials/javascript/build-a-restful-api-using-node-and-express-4 It is working if all lines are on server.js file. But I am failing to separate. How can I make this work? server.js // set up ====================================================================== var express = require('express'); var app = express(); var bodyParser = require('body-parser'); // configuration =============================================================== app.use(bodyParser()); var port = process.env.PORT

RouterModule.forRoot(ROUTES) vs RouterModule.forChild(ROUTES)

Deadly 提交于 2019-11-26 23:47:04
What is the differences between these two and what are the use cases for each? The docs aren't exactly helpful: forRoot creates a module that contains all the directives, the given routes, and the router service itself. forChild creates a module that contains all the directives and the given routes, but does not include the router service. My vague guess is that one is for the 'main' module and the other is for any imported modules (since they would already have the service available from the main module), but I can't really think of a use case. Max Koretskyi aka Wizard I strongly suggest

Angular2 Router error: cannot find primary outlet to load 'HomePage'

倖福魔咒の 提交于 2019-11-26 22:22:03
问题 I just started using the new routing library (@angular/router v3.0.0-alpha.7) but following the official docs leads to error below: browser_adapter.ts:74: EXCEPTION: Error: Uncaught (in promise): Error: Cannot find primary outlet to load 'HomePage' Question is - how do I get rid of the error and make the router behave as expected? Have I missed a setting? (Same error appears when using the alpha.6 version.) app.component.ts import { Component } from '@angular/core'; import { ROUTER_DIRECTIVES