GithubHelp home page GithubHelp logo

anywhere's Introduction

Hi there 👋

Here are some ideas to get you started:

anywhere's People

Contributors

dependabot[bot] avatar gimjin avatar hstarorg avatar jacksontian avatar qinshou avatar shenqihui avatar weakish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

anywhere's Issues

可否增加配置项,用来过滤文件后缀

增加一些过滤配置项,用来包含或过滤文件后缀。
在某些情况下,只想将某些文件比如.txt .js .css 等类型文件展示出来,或者不想展示出 .exe .bat 等文件。

可否都重定向到首页

SPA模式下,路由都是前端识别的,页面都只需重定向到首页,比如访问/user/center, 实际只想它跳到/index.html,其他的模块/user/center都由js加载,可否做到,怎么做,谢谢回答!

gzip

目前是不是还没有gzip的功能 可否增加 ?

权限问题

windows会报这个错

Error: EPERM: operation not permitted, stat 'D:\System Volume Information'
   at Error (native)

it can't works any more

node version: 8.9.2
npm version: 5.5.1
OS : windows 10

it works before in former version & how to resolve that

waiting for your reply

anywhere的用途在哪?

想不到随便把一个目录当做静态文件服务器的用途在哪里?可以给举个能直接体现功能的例子么?

windows下中文文件显示乱码

如题,windows默认使用gbk编码,而anywhere使用的connect中间件默认是utf-8编码,我自己尝试修改如下:

app.use(function (req, res, next) {
  res.setHeader("Access-Control-Allow-Origin", "*");
  res.setHeader("Content-type", "text/html; charset: utf-8"); // 设置响应头编码为utf-8
  next();
});

不过很遗憾没有效果,希望作者能够帮忙给以解决,让anywhere越来越强大!

关闭zsh的窗口之后服务并没有关闭

我没有cmd+c退出Node.js,而是直接关闭了zsh窗口,然后我启动的服务并没有停止,需要我找到对应的pid然后手动kill。请问能解决一下么?

Error: spawn xdg-open ENOENT

ubuntu@VM-0-8-ubuntu:~$ anywhere -h localhost -p 8888
Running at http://localhost:8888/
Also running at https://localhost:8889/
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: spawn xdg-open ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

npm: 5.6.0
node: v8.11.1
os: ubuntu 16.04

树莓派 - SSL routines:SSL_CTX_use_certificate:ee key too small

之前树莓派还能用
新装遇到错误

root@pi4-001:/home/pi# anywhere -p 8080 -s
_tls_common.js:135
      c.context.setCert(cert);
                ^

Error: error:140AB18F:SSL routines:SSL_CTX_use_certificate:ee key too small
    at Object.createSecureContext (_tls_common.js:135:17)
    at Server (_tls_wrap.js:903:27)
    at new Server (https.js:62:14)
    at Object.createServer (https.js:85:10)
    at Object.<anonymous> (/root/.nvm/versions/node/v10.23.0/lib/node_modules/anywhere/bin/anywhere:131:7)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

应该是和 jfromaniello/selfsigned#33 类似,key需要改成2048,还望作者可以更新下

anywhere 运行 vite 打包的项目报错

我执行 npm run build 后,再执行 anywhere,错误如下
Uncaught TypeError: Failed to resolve module specifier "vue". Relative references must start with either "/", "./", or "../".
我执行 npm run dev 项目运行正常

是否应该检测浏览器是否存在

https://github.com/JacksonTian/anywhere/blob/master/bin/anywhere#L59

在 Linux Server 端,没有 GUI 没有 Browser, 如果不使用 -s 就会默认打开浏览器产生异常,错误如下:

/workspace anywhere                                                                                 /workspace 130 ↵ 
Running at http://172.17.0.2:8000/
Also running at https://172.17.0.2:8001/
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: spawn xdg-open ENOENT
    at exports._errnoException (util.js:1020:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32)
    at onErrorNT (internal/child_process.js:376:16)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:606:11)
    at run (bootstrap_node.js:383:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:496:3

我的建议,如果要默认打开的话,是否可以增加浏览器检测,或者一些其他手段防止异常,比如 Catch 掉产生 Warning?否则一开始运行的时候很容易搞不清状况,不知道是少了 -s 才能运行。

内存释放问题

下载一个大文件之后,内存飙升,下载完成之后不会释放(除非有新的请求过来,内存才会释放),是否可以优化下?

ubuntu centos下anywhere运行报错

anywhere运行报错,centos和Ubuntu都这样(win下是好的):
anywhere -v

···node
Running at http://10.180.44.232:8000/
Also running at https://10.180.44.232:8001/
events.js:141
throw er; // Unhandled 'error' event
^

Error: spawn xdg-open ENOENT
at exports._errnoException (util.js:870:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at nextTickCallbackWith2Args (node.js:442:9)
at process._tickCallback (node.js:356:17)
at Function.Module.runMain (module.js:443:11)
at startup (node.js:139:18)
at node.js:968:3
···

其他node全局模块是可以运行的。

Command Injection

Hi!

Although currently not exploitable remotely you should always escape user input before passing it to exec() or spawn():

anywhere/bin/anywhere

Lines 51 to 65 in c5c4f8f

switch (process.platform) {
case "darwin":
exec('open ' + url);
break;
case "win32":
exec('start ' + url);
break;
default:
spawn('xdg-open', [url]);
// I use `spawn` since `exec` fails on my machine (Linux i386).
// I heard that `exec` has memory limitation of buffer size of 512k.
// http://stackoverflow.com/a/16099450/222893
// But I am not sure if this memory limit causes the failure of `exec`.
// `xdg-open` is specified in freedesktop standard, so it should work on
// Linux, *BSD, solaris, etc.

for this you can use shellescape() (https://www.npmjs.com/package/shell-escape) or escape(). Otherwise an input like ./anywhere -h "localhost; touch code_exec.txt #" may become exec("open http://localhost; touch code_exec.txt #:8000/") an thus lead to arbitrary code execution (creating a file in this example).

Best
0x6d636c61757373

luckysheet 如何本地引入?

    luckysheet 如何本地引入,官网一行字介绍了,但是表达的不清楚,三个问题。

1,要引入的源文件在哪?
2,文件具体放在代码的哪里?
3,有代码演示吗?

Consider upgrading http-proxy-middleware

There is a security issue that comes from the npm package kind-of.

image

After running the command npm list kind-of, we can see it comes from http-proxy-middleware.

https://snyk.io/test/github/JacksonTian/anywhere

└─┬ [email protected]
  └─┬ [email protected]
    ├─┬ [email protected]
    │ ├─┬ [email protected]
    │ │ └─┬ [email protected]
    │ │   └── [email protected] 
    │ └─┬ [email protected]
    │   └─┬ [email protected]
    │     └── [email protected] 
    ├─┬ [email protected]
    │ └─┬ [email protected]
    │   ├─┬ [email protected]
    │   │ └── [email protected]  deduped
    │   ├─┬ [email protected]
    │   │ └── [email protected]  deduped
    │   └── [email protected]  deduped
    ├─┬ [email protected]
    │ └─┬ [email protected]
    │   └─┬ [email protected]
    │     └─┬ [email protected]
    │       ├─┬ [email protected]
    │       │ └── [email protected] 
    │       ├─┬ [email protected]
    │       │ └── [email protected] 
    │       └── [email protected] 
    ├── [email protected] 
    ├─┬ [email protected]
    │ └── [email protected]  deduped
    └─┬ [email protected]
      ├─┬ [email protected]
      │ ├─┬ [email protected]
      │ │ ├─┬ [email protected]
      │ │ │ └─┬ [email protected]
      │ │ │   └── [email protected] 
      │ │ └─┬ [email protected]
      │ │   └── [email protected] 
      │ └─┬ [email protected]
      │   ├─┬ [email protected]
      │   │ └─┬ [email protected]
      │   │   ├─┬ [email protected]
      │   │   │ └── [email protected] 
      │   │   ├─┬ [email protected]
      │   │   │ └── [email protected] 
      │   │   └── [email protected] 
      │   └─┬ [email protected]
      │     ├─┬ [email protected]
      │     │ └─┬ [email protected]
      │     │   ├─┬ [email protected]
      │     │   │ └── [email protected] 
      │     │   ├─┬ [email protected]
      │     │   │ └── [email protected] 
      │     │   └── [email protected] 
      │     └─┬ [email protected]
      │       ├─┬ [email protected]
      │       │ └─┬ [email protected]
      │       │   ├─┬ [email protected]
      │       │   │ └── [email protected]  deduped
      │       │   ├─┬ [email protected]
      │       │   │ └── [email protected]  deduped
      │       │   └── [email protected] 
      │       └── [email protected] 
      └─┬ [email protected]
        └─┬ [email protected]
          ├─┬ [email protected]
          │ └── [email protected] 
          ├─┬ [email protected]
          │ └── [email protected] 
          └── [email protected] 

Security issue

Hi,

I'm a member of the Node.js Security WG and we received a report regarding a security issue with this module.

We tried inviting the author by e-mail but received no response so I'm opening this issue and inviting anyone with commit and npm publish rights to collaborate with us on a fix.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.