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

Support for (local) URLs with custom Port #234

Open
holgerd77 opened this issue Jun 3, 2015 · 12 comments
Open

Support for (local) URLs with custom Port #234

holgerd77 opened this issue Jun 3, 2015 · 12 comments

Comments

@holgerd77
Copy link

Hi there,
I would like to write some tests for Splash rendering pages on Django powered localhost server running under http://127.0.0.1:8004. This gives back a rendering error when trying to render even a 10-liner HTML page. I tested the same code deployed to a "classic" web server running on port 80.

This worked, so I assume the differing port number is the problem here. Any chance to support this in the near future? This would be really great and actually help me a lot!

Cheers
Holger

@kmike
Copy link
Member

kmike commented Jun 3, 2015

Hi @holgerd77,

Splash own testing suite uses mock server which runs on localhost with non-80 randomly selected port, it shouldn't be a problem.

Did you see anything strange in Splash logs? There is -v2 (or -v3) option to enable a more detailed logging.

@holgerd77
Copy link
Author

Oh, I didn't dig myself through to the Docker console yet, there it is saying "Connection refused", so probably it's some Docker connection thing.

If you know what to do I would be glad for an answer but if you're busy I'l probably/hopefully also figure out myself! :-)

@kmike
Copy link
Member

kmike commented Jun 3, 2015

Hm, maybe for Splash the address of your server is not 127.0.0.1, because 127.0.0.1 is a localhost of Splash Docker container?

@holgerd77
Copy link
Author

Yes, has something to do with it, using Kitematic on Mac OS, working on figuring out how to get out of this thing again. :-)

@holgerd77
Copy link
Author

@holgerd77
Copy link
Author

If you find a fitting place (directly in "Installation" section) maybe that's worth to include a line in the docs, not so uncommon use-case after all for people first testing/running against localhost.

@kmike
Copy link
Member

kmike commented Jun 5, 2015

@holgerd77 yes, it is a good idea to document it. "Installation" section looks good because it discusses Docker; we can also add a FAQ / Common Issue document with common gotchas like this. I'll leave this issue open until we document a workaround. PRs are welcome :)

@holgerd77
Copy link
Author

Hi @kmike, I've now added ScrapyJS/Splash support into the latest release of my Scrapy/Django app:
http://django-dynamic-scraper.readthedocs.org/en/latest/development.html#release-notes
Works like a charm, thanks again for your help! :-)

@mappelgren
Copy link

Hi, I had a similar problem, and @kmike linked me here. So as I understand it, instead of localhost I should use 10.0.2.2? Do I need to add/change any settings? Currently when I'm trying to render that address I get a 504 timeout exceeded error. I just want to make sure I'm not misunderstanding the solution.

@holgerd77
Copy link
Author

You don't have to be so sure about the right solution before testing anything, you really can't break anything here, so just try out the address changes and see what happens.

Having said that: yes, 10.0.2.2 is the IP adress mapping from within the Docker container to your outside (normal) computer environment localhost adress. So use e.g. 10.0.2.2:8050 if you have got a webserver there running on port 8050, that should then go through.

@mappelgren
Copy link

Thanks. I did try but when I did I got 504 time out errors. Which is why I asked, but since it seems to at least be trying to get the page (which it didn't earlier), it must be because of something else.

@davisbra
Copy link

@kmike Hi. i have similiar question, but i dont have more info about splash, docker, ... . how can i render freenet websites (freesite) with splash which addresses are like: http://localhost:8888/freenet:USK@qd-hk0vHYg7YvK2BQsJMcUD5QSF0tDkgnnF6lnWUH0g,xTFOV9ddCQQk6vQ6GjfL6IzRUgmfMcZJ6nuySuNUc,AQACAAE/activelink-index/125 . I defined a new proxy profile and add it to yml file, but i got connection refused error. please giude me in detail. thank you.

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