Comments (9)
One finding: if i start total.js with my vm's IP framework.run(http, debug, 8000, '192.168.3.3');
i can access it via 192.168.3.3:8000 from the host.
But i don't understand why it doesn't work for localhost.
from examples.
Hi @extropianer, localhost is defined in host file and it's routed to:
127.0.0.1 localhost ::1 localhost
So my question: why do you need in URL localhost?
Thanks.
from examples.
Thanks for the quick reply!
Usually when i run (node) apps in my virtual machine i can access them via 127.0.0.1 or localhost from my host machine.
But when i run total.js i need to add my virtual machine IP? This works but i wonder why it is like that. I am used to 127.0.0.1
from examples.
Can you access into your virtual machine via 127.0.0.1 or localhost?
Is this possible? I think that no.
But when i run total.js i need to add my virtual machine IP?
Yes, but I don't know what VM you are using.
from examples.
Sorry for the late reply.
I am using vagrant box with port forwarding on 3000 (my usual port) and 8000 (for totaljs default).
If i make an express server:
var express = require('express');
var app = module.exports = express();
app.get('/', function (req,res) {
res.send('hello world');
});
var port = process.env.PORT || 8000;
app.listen(port, function() {
console.log('Listening on ' + port);
});
..everything works. So port forwarding is set up correctly. And i can access the website from outside the VM at localhost:8000 or 127.0.0.1:8000.
If i use total.js the same way it does not work.
Screenshots:
- http://imgur.com/CzaedZD basic express server on localhost:8000 works
- http://imgur.com/EDltxil totaljs example with local IP works
- http://imgur.com/69kdgwI default totaljs example localhost:8000 does not work
Now that i found out my VM local IP works i can start enjoying totaljs :)
Feel free to close this issue. If you want to find out why localhost:8000 does not work i can provide you with more information if needed.
from examples.
I don't know to help with it.
Sorry.
from examples.
Sorry to necro, but i have same problem
In the spirit of keeping our dev machine as close to production, we use VM for dev server with similiar image as deploy server. For simplicity we use port forwarding on dev server (similiar to @extropianer)
In my opinion, port forwarding doesn't work because totaljs binds to one listen address (default to 127.0.0.1)
Is there any way to make totaljs listens to ANY (*) address?
I tried using options.ip = '*'
, doesn't work because the address is non resolvable. Setting it to empty string options.ip = ''
reverts back to default (127.0.0.1)
from examples.
Try to set options.ip = 'auto'
and give me a feedback.
auto
sets ip to undefined
.
Thanks!
from examples.
setting options.ip = 'auto'
does the trick
thanks a lot for the solution and fast reply :)
from examples.
Related Issues (20)
- remote-terminal 无法输入
- Errors when running assertion-testing example HOT 1
- [Nuxt-Middleware] Error "hot-update" when change .vue file. HOT 3
- I can't run ANY of the examples ... ? HOT 3
- Can we work with Swagger in total.js HOT 2
- Roles in authorization HOT 2
- How to Set action Body from outside HOT 2
- How to work with socket.io in total.js? HOT 1
- This script needs improvement. HOT 1
- angular 4 with server side render HOT 1
- next-js HOT 3
- Any examples of how to wrap self.$get(self, self.callback()) in controller? HOT 1
- bad url in documentation HOT 1
- Compile .scss freeze HOT 9
- the export of functions in business logic does not work HOT 5
- ReferenceError: MAIN is not defined HOT 2
- Failed to run examples/postgres: require(...).init is not a function HOT 1
- Session and roles HOT 2
- Totaljs with elasticsearch HOT 1
- TypeError: HTTP(...) is not a function TypeError: HTTP(...) is not a function HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from examples.