Mercurial > hg > Members > nobuyasu > tightVNCProxy
changeset 30:a0e1fc94d344
print out html file's text
author | e085711 |
---|---|
date | Wed, 27 Apr 2011 02:33:08 +0900 |
parents | dd761c2b3ef8 |
children | cb0e4fd2d982 |
files | src/myVncProxy/MyRfbProto.java src/myVncProxy/ProxyVncCanvas.java src/myVncProxy/VncCanvas.java src/myVncProxy/VncProxyService.java |
diffstat | 4 files changed, 39 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/src/myVncProxy/MyRfbProto.java Tue Apr 26 21:35:04 2011 +0900 +++ b/src/myVncProxy/MyRfbProto.java Wed Apr 27 02:33:08 2011 +0900 @@ -85,6 +85,7 @@ cliList.add(sock); } void addSockTmp(Socket sock){ + System.out.println("connected "+sock.getInetAddress()); cliListTmp.add(sock); } @@ -224,7 +225,7 @@ mark(rectW * rectH * 4 + 16); break; case RfbProto.EncodingZRLE: - mark(zLen); + mark(zLen+20); break; default: mark(1000000);//適当
--- a/src/myVncProxy/ProxyVncCanvas.java Tue Apr 26 21:35:04 2011 +0900 +++ b/src/myVncProxy/ProxyVncCanvas.java Wed Apr 27 02:33:08 2011 +0900 @@ -543,7 +543,8 @@ rfb.bufResetSend(bufSize); if(rfb.createBimgFlag){ - bimg = createBufferedImage(rawPixelsImage); +// bimg = createBufferedImage(rawPixelsImage); + bimg = createBufferedImage(memImage); //bimg(BufferedImage) -> rfb.pngBytes(byte[]) rfb.createPngBytes(bimg); rfb.sendPngImage();
--- a/src/myVncProxy/VncCanvas.java Tue Apr 26 21:35:04 2011 +0900 +++ b/src/myVncProxy/VncCanvas.java Wed Apr 27 02:33:08 2011 +0900 @@ -565,9 +565,10 @@ rfb.bufResetSend((int)bufSize); if(rfb.createBimgFlag){ - bimg = createBufferedImage(rawPixelsImage); +// bimg = createBufferedImage(rawPixelsImage); + bimg = createBufferedImage(memImage); rfb.createPngBytes(bimg); - createBimgFlag = false; + rfb.createBimgFlag = false; boolean result = false; try{ result = ImageIO.write(bimg, "png", new File("sample.png"));
--- a/src/myVncProxy/VncProxyService.java Tue Apr 26 21:35:04 2011 +0900 +++ b/src/myVncProxy/VncProxyService.java Wed Apr 27 02:33:08 2011 +0900 @@ -8,9 +8,13 @@ public static void main(String[] argv) { VncProxyService v = new VncProxyService(); + + v.checkArgs(argv); + v.mainArgs = argv; v.init(); + } String[] mainArgs; @@ -53,6 +57,15 @@ int debugStatsExcludeUpdates; int debugStatsMeasureUpdates; + + void checkArgs(String[] argv){ + if(argv.length < 2){ + System.out.println("Please enter argv"); + System.out.println("hostname(IPaddress) port password"); + System.exit(0); + } + } + // // init() // @@ -97,7 +110,12 @@ try { // connectAndAuthenticate(); doProtocolInitialisation(); - + + System.out.println("<APPLET CODE=\"VncViwer.class\" ARCHIVE=\"VncViewer.jar\"\n " + + "WIDTH=\""+rfb.framebufferWidth+"\" HEIGHT=\""+rfb.framebufferHeight+"\">"); + System.out.println("<PARAM NAME=\"PORT\" VALUE=\""+rfb.getAcceptPort()+"\">"); + System.out.println("<PARAM NAME=\"HOST\" VALUE=\""+host+"\">"); + vc = new ProxyVncCanvas(this, 0, 0); vc.updateFramebufferSize(); @@ -227,8 +245,8 @@ // String askPassword() throws Exception { - showConnectionStatus(null); /* + * showConnectionStatus(null); * AuthPanel authPanel = new AuthPanel(this); * * GridBagConstraints gbc = new GridBagConstraints(); gbc.gridwidth = @@ -241,7 +259,8 @@ authPanel.moveFocusToDefaultField(); vncContainer.remove(authPanel); */ - String pw = mainArgs[2]; + showConnectionStatus("ask password..."); + String pw = mainArgs[1]; return pw; } @@ -260,7 +279,7 @@ setEncodings(); - showConnectionStatus(null); + //showConnectionStatus(null); } // @@ -494,15 +513,15 @@ void readParameters() { - if (mainArgs.length > 0) - host = mainArgs[0]; - else - host = "hades.cr.ie.u-ryukyu.ac.jp"; + host = mainArgs[0]; + if(mainArgs.length < 3){ + port = 5900; + }else{ + port = Integer.parseInt(mainArgs[2]); + } - if (mainArgs.length > 1) - port = Integer.parseInt(mainArgs[1]); - else - port = 5900; + + // Read "ENCPASSWORD" or "PASSWORD" parameter if specified. // readPasswordParameters(); @@ -549,7 +568,7 @@ private void readPasswordParameters() { // String encPasswordParam = readParameter("ENCPASSWORD", false); - String encPasswordParam = mainArgs[2]; + String encPasswordParam = mainArgs[1]; if (encPasswordParam == null) { // passwordParam = readParameter("PASSWORD", false);