Closed aogg closed 2 years ago
-p 8080
-p 不行
bash-5.1# n2 -p 8898 -o 172.17.0.2 start [i] nohost@0.6.0 started [i] use your device to visit the following URL list, gets the IP of the URL you can access: http://127.0.0.1:8898/ http://172.17.0.2:8898/ Note: If all the above URLs are unable to access, check the firewall settings For help see https://nohost.pro/ bash-5.1# bash-5.1# wget -O - http://172.17.0.2:8898/ Connecting to 172.17.0.2:8898 (172.17.0.2:8898) wget: can't connect to remote host (172.17.0.2): Connection refused
wget -O - http://172.17.0.2:8898/
这个错在哪里, 127.0.0.1是可以的
wget -O - http://172.17.0.2:8898/
这个错在哪里, 127.0.0.1是可以的
wget -O - http://172.17.0.2:8898/
这个错在哪里, 127.0.0.1是可以的
wget -O - http://172.17.0.2:8898/
这个错在哪里, 127.0.0.1是可以的
bash-5.1# n2 start [i] nohost@0.6.0 started [i] use your device to visit the following URL list, gets the IP of the URL you can access: http://127.0.0.1:8080/ http://172.17.0.2:8080/ Note: If all the above URLs are unable to access, check the firewall settings For help see https://nohost.pro/ bash-5.1# bash-5.1# wget -O - http://172.17.0.2:8080/ Connecting to 172.17.0.2:8080 (172.17.0.2:8080) writing to stdout
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"/>
<link rel="shortcut icon" href="favicon.ico" />
这个成功了,-p果然有bug啊
默认是监听所有网卡,可能172.17.0.2:8080
被占用了,或某些原因监听不上,可以试试:
n2 -p " 172.17.0.2:8898" -o 172.17.0.2 start
Nohost 版本可以更新下
估计是版本问题
whistle for Dockerfile
FROM alpine:latest
RUN set -ex && \ apk update && \ apk upgrade && \ apk add --no-cache bash && \ apk add --no-cache nodejs-npm && \ npm i -g @nohost/server --registry=https://r.npm.taobao.org
ENTRYPOINT ["n2", "run"]
这个的docker容器指定别的端口都无法启动