Comments (17)
Use the whitelist string from the example. https://github.com/switchbrew/switch-examples/blob/master/applet/libapplets/web/source/main.c
Did you try to log anything from your server?
from libnx.
That whitelist doesn't have any effect either. Yeah, i am logging connections but i just don't get any. connecting from pc does show logs. Its as if i can not establish a connection to it whatsoever.
from libnx.
Tried using port 80?
from libnx.
no, 1234
but it should not matter, since i can specify a port in the url for the webapplet and thats working just fine. ill try anyway.
Edit: I cant bind port 80. (errno 13)
Edit2: I could provide a repository if that makes things easier.
from libnx.
Edit2: I could provide a repository if that makes things easier.
sure
from libnx.
Edit2: I could provide a repository if that makes things easier.
sure
https://github.com/Slluxx/serverxbrowser
For testing purposes, i changed the thread to open the webbrowser instead of running the webserver, due to printf's inside a thread are leading to crashes. the current solution is also not great because it should use locked_printf
but right now it works.
from libnx.
FWIW you can use standard threads - you don't have to directly use libnx threads. Large buffers like char buffer[8192];
should really be moved to non-stack as well.
from libnx.
Ah, didnt know. i was just using the threads that were in all the switchbrew examples. is there any disadvantage by using those? And what does moved to non-stack as well.
mean "in code"? I understand C/++ mostly by looking at code and people saying things like that usually just pops up a big questionmark above my head. Also, why is it benefitial to move it there?
from libnx.
Your process is likely not running while the applet is active. You need to use webSession (see web.h), or if pre-7.0.0 system-version support is really required, use appletSetFocusHandlingMode.
Normally you should use standard threads, unless you really want cooperative thread scheduling. static char buffer[...]
would be good enough, would move it from stack to .data (large buffers doesn't really belong on stack). Using fsInitialize/fsExit isn't needed, that's used automatically by libnx for apps.
from libnx.
Your process is likely not running while the applet is active.
But why can i still access the webserver on my pc while the applet is active? Shouldn't that mean that the process is in fact running? To serve content, it has to run in a loop for polling, evaluating and responding - which it obviously does.
I will write file logs to confirm that. Pretty sure the issue lies somewhere else.
Using fsInitialize/fsExit isn't needed, that's used automatically by libnx for apps.
understood, will be removed.
static char buffer[...]
would be good enough
thanks for the clarification!
Edit: Logs show that the current way of threading and opening the applet does not stop the main loop from executing.
from libnx.
What exactly is the use-case for this?
The applet opens but cant connect to the server on 127.0.0.1, localhost or {Switch IP addr}. ... with the error code "2800-1007".
Likewise here without a server running.
localhost
and 127.0.0.1
are explicitly blacklisted by the web-applet itself AFAICT.
from libnx.
What exactly is the use-case for this?
i am experimenting with different kind of servers and webpages to create html/css/js homebrew guis, instead of using sdl or something else.
localhost and 127.0.0.1 are explicitly blacklisted by the web-applet itself AFAICT.
due to this info, i tried accessing the server via atmospheres dns mitm service.
using my switches lan adress and a random domain name worked perfectly fine.
Its not really a solution i want to use but it works to experiment with things.
Is there a way to remove those adresses from the blacklist somehow?
from libnx.
You could use webOffline for that, with webSession if needed.
Is there a way to remove those adresses from the blacklist somehow?
That requires patching the web-applet codebin.
from libnx.
i am trying to use weboffline as suggested but my switch just crashes with a 0x4a2 which doesnt help a lot.
WebCommonConfig conf;
WebCommonReply out;
webOfflineCreate(&conf, WebDocumentKind_OfflineHtmlPage, 0 , "/");
webConfigSetWhitelist(&conf, "^http*");
webConfigShow(&conf, &out);
It crashes upon executing webConfigShow
. I thought it may be that i have to use /index.html
instead of a path?
i am also confused about where to put the index file. From the docs i am understanding romfs:/html-document/index.html
but not quite sure if thats right.
from libnx.
Path is relative to SD /atmosphere/hbl_html/html-document/
- you should probably include your app-name or similar in the path.
from libnx.
and no way of having it in romfs of the homebrew?
from libnx.
AMS only loads user-specified-content for that romfs from that /atmosphere/hbl_html/
dir.
from libnx.
Related Issues (20)
- inet_pton() failure for 0.0.0.0
- Can't open file sys/lock.h HOT 1
- Linking errors with nwindowGetDefault() HOT 8
- Rotated/Normalized controller layouts using the pad abstraction API HOT 2
- Question: Home button HOT 3
- SL/SR buttons usage on hiddbg HOT 6
- Linear framebuffer crashes on certain dimensions HOT 2
- hidScanInput() was not declared in this scope HOT 6
- When i try to compile a .nro in devkitpro, i get this error: HOT 3
- Question: Video HW Decoder HOT 9
- Nintendo HOT 1
- make a relase/how to compile it HOT 2
- ASCII Usage of "\" HOT 2
- Problem to print special chars in console mode HOT 4
- bool to pointer
- Wrong Github (sorry)
- Support: How to get a list of installed DLCs? HOT 2
- devkitPro on NixOS? HOT 1
- Support for HID Vibrations HOT 6
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 libnx.