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

Change default server address?? #4

Open
duncansykes opened this issue Jul 8, 2018 · 3 comments
Open

Change default server address?? #4

duncansykes opened this issue Jul 8, 2018 · 3 comments

Comments

@duncansykes
Copy link

How do I change the default address from localhost (127.0.0.1) to something else, like 0.0.0.0.

I'm trying to develop a web interface that can be accessed by multiple devices on the same network.

@miyakogi
Copy link
Owner

miyakogi commented Jul 8, 2018

First of all, WDOM is not designed to be accessed by multiple clients.
In such case, unexpected behavior may occur and I can't guarantee it works correctly.

If still you want to use wdom for such purpose, you can pass address and port to wdom.server.start function as keyword arguments.

start(address='0.0.0.0', port=12345)

@QGB
Copy link

QGB commented Aug 16, 2019

@miyakogi @bpgas01

you can also use
python wdom_test.py --address 0.0.0.0 --port 43214

@bobwatcherx
Copy link

i get error

root@miop-HP-Convertible-x360-11-ab1XX:/home/miop/belajar/wdom# python3 main.py
Traceback (most recent call last):
File "/home/miop/belajar/wdom/main.py", line 1, in
from wdom.document import get_document
File "/usr/local/lib/python3.10/dist-packages/wdom/document.py", line 25, in
from wdom.tag import Tag
File "/usr/local/lib/python3.10/dist-packages/wdom/tag.py", line 7, in
from collections import Iterable
ImportError: cannot import name 'Iterable' from 'collections' (/usr/lib/python3.10/collections/init.py)

my code

from wdom.document import get_document
from wdom.server import start

if __name__ == '__main__':
    document = get_document()
    h1 = document.createElement('h1')
    h1.textContent = 'Hello, WDOM'
    document.body.appendChild(h1)
    start(address="0.0.0.0",port=3000)

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

4 participants