使用端口443连接到Heroku [英] Connecting to Heroku using port 443

查看:205
本文介绍了使用端口443连接到Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是一名大学生,除80,443外的所有港口都被封锁。我可以通过

 主机github.com 
主机名ssh.github.com $ b $连接到github b端口443

git push heroku master 给出我这个错误:

  ssh:连接到主机heroku.com端口22:连接被拒绝
致命:远端意外地挂了

我试过解决方法发布这里,但我仍然没有得到它的工作。有没有一种方法可以连接到heroku部署我的网站?



非常感谢

解决方案

希望使用备用端口进入heroku,那么您可以考虑隧道



对于隧道,您需要在阻塞的网络之外拥有额外的PC或服务器,并且可以访问端口22。

对于下面的情况,我们可以使用家庭PC来连接到Heroku服务器。由于大学网络只允许80端口和443端口,因此我们可以将House PC设置为通过端口443接收连接并将其连接到端口22上。



在众议院PC:


  1. 在家用PC上配置SSH服务器以运行在端口443上。请参考此处在多个端口上配置SSH服务器

大学计算机:
$ b


  1. 配置University PC以解析git_tunnel别名以指向端口9001上的localhost。编辑〜/ .ssh / config 并添加以下内容:

     #〜/ .ssh / config 

    主机git_tunnel
    主机名127.0.0.1
    用户git
    Port 9001


  2. 将一个新的远程别名添加为隧道它将指向 git @ git_tunnel:{app name} .git



    git remote a从大学PC建立隧道到家用电脑,它监听端口443



    ssh -L 9001:heroku.com:22 -p 443 root@housepc.com tunnel 部署到heroku



  3. git push tunnel master



I'm a university student and all ports except 80, 443 are blocked. I'm able to connect to github via

Host github.com                                                                                    
  Hostname ssh.github.com
  Port 443

git push heroku master gives me this error:

ssh: connect to host heroku.com port 22: Connection refused
fatal: The remote end hung up unexpectedly

I've tried the solutions posted here on SO but I've still not got it working. Is there a way I can connect to heroku do deploy my websites?

Thanks a lot

解决方案

If your SSH port been blocked and wish to push into heroku using alternate port then you may consider Tunneling.

For tunneling you are required to have additional PC or Server resides outside of blocked network and having access to Port 22.

For the scenario below we can use house PC to tunnel into heroku server. Since the university network only allow Port 80 and 443, we can set the House PC to receive connection via port 443 and tunnel it to port 22.

At House PC:

  1. Configure SSH server in the house PC to run on port 443. Refer here to configure SSH Server on Multiple Ports

University PC:

  1. Configure University PC to resolve git_tunnel alias to point to localhost on port 9001. Edit ~/.ssh/config and add following

    # ~/.ssh/config
    
    Host git_tunnel
       Hostname 127.0.0.1
       User git
       Port 9001
    

  2. Add a new remote alias as tunnel which will point to git@git_tunnel:{app name}.git

    git remote add tunnel git@git_tunnel:{app name}.git

  3. From the University PC establish tunnel to house PC which listening on port 443.

    ssh -L 9001:heroku.com:22 -p 443 root@housepc.com

  4. Deploy to heroku using alias tunnel created earlier

    git push tunnel master

这篇关于使用端口443连接到Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆