Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can i change the url at runtime? #147

Open
viandanteoscuro opened this issue Aug 18, 2016 · 1 comment
Open

How can i change the url at runtime? #147

viandanteoscuro opened this issue Aug 18, 2016 · 1 comment

Comments

@viandanteoscuro
Copy link

Hi to all!

In my nodejs server i have two routes:

app.get('/', function(req, res){
    res.sendFile(__dirname + '/test.html');
});

app.get('/test', function(req, res){
    console.log("Test PAth");
});

My factory is:

factory('socket', function (socketFactory) {

        var socket = socketFactory({
            ioSocket: io('http://servertest:3000')
        });
 });

In my controllers i wish to change to http://servertest:3000/test at runtime.

Is it Possible?

Thanks!

Massimo

@wsloth
Copy link

wsloth commented Aug 18, 2016

Are you perhaps looking for this?: http://socket.io/docs/rooms-and-namespaces/

Do I understand you correctly that you want to create a new Socket.IO connection from the clientside based on which URL the webpage is currently on?
So / on the root and /test on the test page

Also, this is not really an issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants